Civilization
Chat.hpp
1 // Generated by dia2code
2 #ifndef CLIENT__CHAT__H
3 #define CLIENT__CHAT__H
4 
5 #include <array>
6 #include <SFML/Graphics.hpp>
7 #include <vector>
8 #include <string>
9 #include <mutex>
10 #include <memory>
11 
12 namespace client {
13  class Button;
14 }
15 
16 #include "Button.hpp"
17 
18 namespace client {
19 
21  class Chat {
22  // Attributes
23  public:
24  std::array<sf::Text, 10> gameChat;
25  std::vector<Button> chatButton;
26  std::string message = "";
27  std::mutex mutexChat;
28  sf::Font chatFont;
29  // Operations
30  public:
31  Chat ();
32  void updateChat (std::string time, std::string username, std::string sendMessage);
33  void incrementChat ();
34  void drawChat (std::shared_ptr<sf::RenderWindow> window);
35  void addChatChar (std::string ch);
36  void deleteChatChar ();
37  // Setters and Getters
38  };
39 
40 };
41 
42 #endif
class Chat -
Definition: Chat.hpp:21
void updateChat(std::string time, std::string username, std::string sendMessage)
update the Chat with a string
Definition: Chat.cpp:80
Chat()
Load all the chat.
Definition: Chat.cpp:30
void addChatChar(std::string ch)
Add a char to the chat message.
Definition: Chat.cpp:115
void deleteChatChar()
Delete a char to the chat message.
Definition: Chat.cpp:134
void incrementChat()
Move the index of text to i –.
Definition: Chat.cpp:66
void drawChat(std::shared_ptr< sf::RenderWindow > window)
display the entire Chat
Definition: Chat.cpp:150