4#include <tt/world/Variable.h>
5#include <tt/world/Signature.h>
28 Assignment(): variable(nullptr), value(nullptr),
visible(false) {};
52 const std::string&
getCode()
const;
70 friend void from_json(
const nlohmann::json& j,
Assignment& obj);
71 friend void to_json(nlohmann::json& j,
const Assignment& obj);
72 friend std::ostream&
operator<<(std::ostream& os,
const Assignment& a);
76 std::string description;
80 std::unique_ptr<Variable> variable;
82 std::unique_ptr<Value> value;
85 void from_json(
const nlohmann::json& j,
Assignment& obj);
86 void to_json(nlohmann::json& j,
const Assignment& obj);
An assignment is a logical formula that asserts that some variable in a story world has a value.
Definition Assignment.h:18
std::string toString() const
Returns a string representation of this object.
Definition Assignment.cpp:8
const Value * getValue() const
Returns the value the variable is assigned.
Definition Assignment.cpp:28
const Variable * getVariable() const
Returns the variable being assigned a value.
Definition Assignment.cpp:23
const std::string & getDescription() const
Returns a human-readable natural language description of the object.
Definition Assignment.cpp:13
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 Assignment.cpp:18
bool visible
Whether or not this assignment can currently be observed.
Definition Assignment.h:26
friend std::ostream & operator<<(std::ostream &os, const Assignment &a)
Override stream insertion operator to allow printing the Assignment class.
A value is a logical expression which evaluates to itself.
Definition Value.h:17
A variable is an asset that represents a feature of the story world state that can change.
Definition Variable.h:19
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