4#include <tt/world/Entity.h>
5#include <tt/world/Signature.h>
6#include <unordered_set>
48 const std::unordered_set<const Entity*>&
getConsenting()
const;
85 const std::string&
getCode()
const;
96 friend void from_json(
const nlohmann::json& j,
Action& obj);
97 friend void to_json(nlohmann::json& j,
const Action& obj);
99 bool operator==(
const Action& rhs)
const;
105 std::vector<std::unique_ptr<Entity>> consenting;
107 mutable std::unordered_set<const Entity*> consentingSet;
110 std::string description;
114 std::unique_ptr<Signature> signature;
117 void from_json(
const nlohmann::json& j,
Action& obj);
118 void to_json(nlohmann::json& j,
const Action& obj);
An action is a signed asset that causes a change in a story world's state.
Definition Action.h:21
const std::unordered_set< const Entity * > & getConsenting() const
Returns an unmodifiable set of entities in the story world representing the characters who need to ag...
Definition Action.cpp:9
bool consents(Role role) const
Returns true if the given story role controls one or more of the consenting characters for this actio...
Definition Action.cpp:19
std::string name
This asset's name, which is unique among other assets of the same type.
Definition Action.h:26
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 Action.cpp:46
const std::string & toString() const
Returns a string representation of this object.
Definition Action.cpp:36
const std::string & getDescription() const
Returns a human-readable natural language description of the object.
Definition Action.cpp:41
friend std::ostream & operator<<(std::ostream &os, const Action &a)
Override stream insertion operator to allow printing the Action class.
const Signature * getSignature() const
Returns the signature of this object.
Definition Action.cpp:51
Action()
Constructs a new blank action.
Definition Action.h:32
int id
This asset's ID number, which is unique among other assets of the same type.
Definition Action.h:24
A signature is a logical object that identifies a parameterized asset in a story world.
Definition Signature.h:22
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
std::ostream & operator<<(std::ostream &os, const Client &a)
Override stream insertion operator to allow printing the Client class.
Definition Client.cpp:556