3#include <tt/world/Action.h>
83 const std::string&
getCode()
const;
92 friend std::ostream&
operator<<(std::ostream& os,
const Turn& a);
94 friend void from_json(
const nlohmann::json& j, Turn& obj);
95 friend void to_json(nlohmann::json& j,
const Turn& obj);
99 std::unique_ptr<Action> action;
102 std::string description;
108 void from_json(
const nlohmann::json& j,
Turn& obj);
109 void to_json(nlohmann::json& j,
const Turn& obj);
An action is a signed asset that causes a change in a story world's state.
Definition Action.h:21
A turn is one participant in a session communicating their intentions for an action to the other part...
Definition Turn.h:26
const Action * getAction() const
Returns the action associated with this turn.
Definition Turn.cpp:24
Type
The kind of turn being taken.
Definition Turn.h:29
@ FAIL
Used to reject a proposed action.
Definition Turn.h:45
@ PROPOSE
Used when one participant wants to suggest taking an action that requires the approval of their partn...
Definition Turn.h:34
@ SUCCEED
Used when one participant agrees to take a proposed action, or when a participant can take an action ...
Definition Turn.h:40
@ PASS
Used when one participant does not want to act and wants to allow their partner to act instead.
Definition Turn.h:51
std::string toString() const
Returns a string representation of this object.
Definition Turn.cpp:6
Type type
The kind of turn being taken.
Definition Turn.h:57
const std::string & getDescription() const
Returns a human-readable natural language description of the object.
Definition Turn.cpp:14
Role role
The role of the participant taking this turn.
Definition Turn.h:55
friend std::ostream & operator<<(std::ostream &os, const Turn &a)
Override stream insertion operator to allow printing the Turn class.
const std::string & getCode() const
Returns a string of 1's and 0's that uniquely represents this object among other objects of the same ...
Definition Turn.cpp:19
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22
std::string ttos(Turn::Type type)
Utility function to get the string representation of a tt::Turn type.
Definition Turn.cpp:59
Turn::Type stot(std::string s)
Utility function to get the correct tt::Turn type enum from the string representation.
Definition Turn.cpp:76
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