TT Client Library 1.0.0
C++ library for Tandem Tales clients.
Loading...
Searching...
No Matches
tt::Assignment Class Reference

An assignment is a logical formula that asserts that some variable in a story world has a value. More...

#include <tt/world/Assignment.h>

Public Member Functions

std::string toString () const
 Returns a string representation of this object.
const std::string & getDescription () const
 Returns a human-readable natural language description of the object.
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 type in the same story world.
const Variable * getVariable () const
 Returns the variable being assigned a value.
const Value * getValue () const
 Returns the value the variable is assigned.

Public Attributes

bool visible
 Whether or not this assignment can currently be observed.

Friends

std::ostream & operator<< (std::ostream &os, const Assignment &a)
 Override stream insertion operator to allow printing the Assignment class.

Detailed Description

An assignment is a logical formula that asserts that some variable in a story world has a value.

Author
Gage Birchmeier

Member Function Documentation

◆ getCode()

const std::string & tt::Assignment::getCode ( ) const

Returns a string of 1's and 0's that uniquely represents this object among other objects of the same type in the same story world.

Every encoded object of the same type should return a string of the same length, even if it must be padded with 0's.

Returns
a string of 1's and 0's

◆ getDescription()

const std::string & tt::Assignment::getDescription ( ) const

Returns a human-readable natural language description of the object.

Returns
a human-readable natural language description of the object

◆ getValue()

const Value * tt::Assignment::getValue ( ) const

Returns the value the variable is assigned.

Returns
a pointer to the value

◆ getVariable()

const Variable * tt::Assignment::getVariable ( ) const

Returns the variable being assigned a value.

Returns
a pointer to the variable being assigned a value

◆ toString()

std::string tt::Assignment::toString ( ) const

Returns a string representation of this object.

Returns
a string describing this object

◆ operator<<

std::ostream & operator<< ( std::ostream & os,
const Assignment & a )
friend

Override stream insertion operator to allow printing the Assignment class.

Parameters
osan output stream to insert into
aa reference to an assignment object
Returns
the output stream referenced

Member Data Documentation

◆ visible

bool tt::Assignment::visible

Whether or not this assignment can currently be observed.

When an assignment can be observed, it is known to be the case. When it cannot be observed, it represents an assumed or last known value of the variable.


The documentation for this class was generated from the following files: