4#include <nlohmann/json.hpp>
5#include <tt/world/Value.h>
20 static constexpr std::string_view
TYPE =
"Entity";
57 const std::string&
getCode()
const;
59 std::string
toString()
const override;
61 virtual std::string_view
getType()
const override;
63 friend void from_json(
const nlohmann::json& j,
Entity& msg);
64 friend void to_json(nlohmann::json& j,
const Entity& msg);
67 virtual bool equals(
const Value& other)
const override;
71 std::string description;
75 void from_json(
const nlohmann::json& j, Entity& msg);
76 void to_json(nlohmann::json& j,
const Entity& msg);
An entity is an asset that represents a character, object, place, or idea in a story world.
Definition Entity.h:17
int id
This asset's ID number, which is unique among other assets of the same type.
Definition Entity.h:23
std::string name
This asset's name, which is unique among other assets of the same type.
Definition Entity.h:25
virtual const Entity * toEntity() const override
If this value represents an tt::Entity, this method returns a pointer to that entity; all other value...
Definition Entity.cpp:25
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 Entity.cpp:15
bool isPlayer() const
Returns true if this entity represents the player character in its story world.
Definition Entity.cpp:5
virtual bool equals(const Value &other) const override
Used for polymorphic ==.
Definition Entity.cpp:35
const std::string & getDescription() const
Returns a human-readable natural language description of the object.
Definition Entity.cpp:10
static constexpr std::string_view TYPE
Type identifier used for deserialization.
Definition Entity.h:20
virtual std::string_view getType() const override
Returns the type of value (either "Entity" or "Constant").
Definition Entity.cpp:30
std::string toString() const override
Returns a string representation of this object.
Definition Entity.cpp:20
A value is a logical expression which evaluates to itself.
Definition Value.h:17
Tandem Tales is a platform that enables short, paired storytelling exercises between two agents over ...
Definition Client.h:22