4#include <tt/world/Turn.h>
5#include <tt/world/State.h>
6#include <tt/world/Ending.h>
28 Status(): state(nullptr), ending(nullptr),
role(
Role::
NONE) {}
43 const std::vector<const Turn *>&
getHistory()
const;
61 const std::vector<const Turn *>&
getChoices()
const;
77 friend void from_json(
const nlohmann::json& j,
Status& obj);
78 friend void to_json(nlohmann::json& j,
const Status& obj);
79 friend std::ostream&
operator<<(std::ostream& os,
const Status& a);
83 std::vector<std::unique_ptr<Turn>> history;
85 std::vector<std::unique_ptr<Entity>> descriptions;
87 std::vector<std::unique_ptr<Turn>> choices;
89 std::unique_ptr<State> state;
94 std::unique_ptr<Ending> ending;
96 mutable std::vector<const Turn *> historyPtrs;
97 mutable std::vector<const Entity *> descriptionsPtrs;
98 mutable std::vector<const Turn *> choicesPtrs;
101 void from_json(
const nlohmann::json& j,
Status& obj);
102 void to_json(nlohmann::json& j,
const Status& obj);
An ending is a signed asset that represents one of several possible ways a story can end.
Definition Ending.h:17
A state is an assignment of values to each variable in a story world.
Definition State.h:18
A status contains the full history of a session in a story world, a description of its current state,...
Definition Status.h:22
Role role
The role of the participant to whom this status is being described.
Definition Status.h:25
const std::vector< const Turn * > & getChoices() const
Returns an unmodifiable list of next turns that this role can take next in the session.
Definition Status.cpp:39
const State * getState() const
Returns a state that gives the current value of all the story world's variables.
Definition Status.cpp:51
const Ending * getEnding() const
Returns the ending the session's story has reached, or null if the story has not yet ended.
Definition Status.cpp:56
const std::vector< const Turn * > & getHistory() const
Returns an unmodifiable list of all turns that have happened so far in the session.
Definition Status.cpp:15
friend std::ostream & operator<<(std::ostream &os, const Status &a)
Override stream insertion operator to allow printing the Status class.
const std::vector< const Entity * > & getDescriptions() const
Returns an unmodifiable list of all the entities that this role can currently see.
Definition Status.cpp:27
std::string toString() const
Returns a string representation of this object.
Definition Status.cpp:7
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
@ NONE
No role, used as a "null" value.
Definition Role.h:32
std::ostream & operator<<(std::ostream &os, const Client &a)
Override stream insertion operator to allow printing the Client class.
Definition Client.cpp:556