shooter/network/Chat.h

28 lines
489 B
C
Raw Normal View History

2023-08-03 01:48:04 +03:00
#ifndef SHOOTER_CHAT_H
#define SHOOTER_CHAT_H
2022-07-22 22:52:54 +03:00
#include <vector>
#include <string>
class ChatManager final {
private:
std::vector<std::string> messages;
std::vector<std::string> authors;
2023-08-03 01:48:04 +03:00
bool isChatUpdate = true;
2023-08-03 01:48:04 +03:00
std::string chatStr;
std::string chatStrPrev;
2022-07-22 22:52:54 +03:00
double hide = 0.0;
2023-08-03 01:48:04 +03:00
void updateChat();
2022-07-22 22:52:54 +03:00
public:
2023-08-03 01:48:04 +03:00
void addNewMessage(const std::string& author, const std::string& message);
2022-07-22 22:52:54 +03:00
int update(double delta);
2023-08-03 01:48:04 +03:00
2022-07-22 22:52:54 +03:00
std::string getChat();
std::string getChatPreview();
2022-07-22 22:52:54 +03:00
};
2023-08-03 01:48:04 +03:00
#endif