#include "../include/Channel.hpp" #include "../include/UsersSidePanel.hpp" #include "../include/ChannelSidePanel.hpp" #include using namespace std; namespace dchat { Channel::Channel(const std::string &_name) : messageBoard(sf::Vector2u(1.0f, 1.0f)), localOfflineUser("You"), name(_name) { { Message *message = new Message(&localOfflineUser, u8"hello, worldåäö1![emoji](https://discordemoji.com/assets/emoji/playtime.png)"); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"hello, world2![emoji](https://discordemoji.com/assets/emoji/Feels3DMan.gif)"); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum."); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"Lorem ipsumdolorsitamet,consecteturadipiscingelit,seddoeiusmodtemporincididuntutaboreetdoloremagnaaliqua.Utenimadminimveniam"); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"xddd"); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"[emoji](https://discordemoji.com/assets/emoji/SlowbroDumb.png)"); messageBoard.addMessage(message); } { Message *message = new Message(&localOfflineUser, u8"Message after big emoji"); messageBoard.addMessage(message); } } Channel::~Channel() { } User* Channel::getLocalUser() { return &localOfflineUser; } MessageBoard& Channel::getMessageBoard() { return messageBoard; } const string& Channel::getName() const { return name; } void Channel::processEvent(const sf::Event &event) { chatbar.processEvent(event, this); messageBoard.processEvent(event); } void Channel::draw(sf::RenderWindow &window, Cache &cache) { ChannelSidePanel::draw(window); messageBoard.draw(window, cache); chatbar.draw(window); UsersSidePanel::draw(window); } }