forked from aya/aya
39 lines
1.1 KiB
C++
39 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "Tree/Service.hpp"
|
|
#include "Tree/Instance.hpp"
|
|
#include "Player.hpp"
|
|
|
|
namespace Aya
|
|
{
|
|
class PartInstance;
|
|
|
|
extern const char* const sChatService;
|
|
|
|
class ChatService
|
|
: public DescribedCreatable<ChatService, Instance, sChatService, Reflection::ClassDescriptor::INTERNAL>
|
|
, public Service
|
|
{
|
|
private:
|
|
void gotFilteredStringSuccess(std::string response, Network::Player* player, boost::function<void(std::string)> resumeFunction,
|
|
boost::function<void(std::string)> errorFunction);
|
|
void gotFilterStringError(std::string error, boost::function<void(std::string)> errorFunction);
|
|
|
|
public:
|
|
enum ChatColor
|
|
{
|
|
CHAT_BLUE,
|
|
CHAT_GREEN,
|
|
CHAT_RED
|
|
};
|
|
|
|
ChatService();
|
|
|
|
void chat(shared_ptr<Instance> instance, std::string message, ChatService::ChatColor chatColor);
|
|
|
|
void filterStringForPlayer(std::string stringToFilter, shared_ptr<Instance> playerToFilterFor, boost::function<void(std::string)> resumeFunction,
|
|
boost::function<void(std::string)> errorFunction);
|
|
|
|
Aya::remote_signal<void(shared_ptr<Instance>, std::string, ChatService::ChatColor)> chattedSignal;
|
|
};
|
|
} // namespace Aya
|