3#include <tt/io/Message.h>
4#include <tt/world/Ending.h>
65 std::string
toString()
const override;
75 std::string
type()
const override {
79 friend void from_json(
const nlohmann::json& j,
Stop& msg);
80 friend void to_json(nlohmann::json& j,
const Stop& msg);
88 std::unique_ptr<Ending> ending;
91 void from_json(
const nlohmann::json& j, Stop& msg);
92 void to_json(nlohmann::json& j,
const Stop& msg);
An ending is a signed asset that represents one of several possible ways a story can end.
Definition Ending.h:17
Message()
Constructs a message.
Definition Message.h:32
The stop message can be sent from either the server or the client to indicate that no more turns will...
Definition Stop.h:38
std::string type() const override
Type used for JSON deserialization.
Definition Stop.h:75
Stop(Role role)
Constructs a stop message for the role who stopped the session before it reached a pre-defined ending...
Definition Stop.cpp:7
Role role
The participant who ended the session, or null if the session reached a pre-defined ending or was end...
Definition Stop.h:44
const Ending * getEnding() const
Returns the ending object sent in this message, or nullptr if there isn't one.
Definition Stop.cpp:33
std::string toString() const override
Returns a string representation of this object.
Definition Stop.cpp:28
std::string message
A message explaining how the session ended.
Definition Stop.h:46
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22
Role
Represents the two roles in a collaborative storytelling session: the Player, who typically controls ...
Definition Role.h:16