3#include <nlohmann/json.hpp>
14 using json = nlohmann::json;
54 virtual std::string
type()
const = 0;
61 virtual std::string
toString()
const;
A client connects to a server to find a partner and play a role in a storytelling session.
Definition Client.h:51
A message is information sent to or from a server in JSON format.
Definition Message.h:23
friend std::ostream & operator<<(std::ostream &os, const Message &a)
Override stream insertion operator to allow printing the Message class.
virtual std::string toString() const
Returns a string representation of this object.
Definition Message.cpp:14
void setClient(const Client *client)
Sets the tt::Client who sent this message.
Definition Message.cpp:9
virtual std::string type() const =0
Type used for JSON deserialization.
Message()
Constructs a message.
Definition Message.h:32
const Client * getClient() const
Returns the tt::Client who sent this message, or null if this message was sent by the server.
Definition Message.cpp:5
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22
std::ostream & operator<<(std::ostream &os, const Client &a)
Override stream insertion operator to allow printing the Client class.
Definition Client.cpp:556
nlohmann::json json
Alias for nlohmann's json.
Definition Message.h:14