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

A status contains the full history of a session in a story world, a description of its current state, and a list of turns that can be taken next (if any). More...

#include <tt/world/Status.h>

Public Member Functions

std::string toString () const
 Returns a string representation of this object.
const std::vector< const Turn * > & getHistory () const
 Returns an unmodifiable list of all turns that have happened so far in the session.
const std::vector< const Entity * > & getDescriptions () const
 Returns an unmodifiable list of all the entities that this role can currently see.
const std::vector< const Turn * > & getChoices () const
 Returns an unmodifiable list of next turns that this role can take next in the session.
const State * getState () const
 Returns a state that gives the current value of all the story world's variables.
const Ending * getEnding () const
 Returns the ending the session's story has reached, or null if the story has not yet ended.

Public Attributes

Role role
 The role of the participant to whom this status is being described.

Friends

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

Detailed Description

A status contains the full history of a session in a story world, a description of its current state, and a list of turns that can be taken next (if any).

Author
Gage Birchmeier

Member Function Documentation

◆ getChoices()

const std::vector< const Turn * > & tt::Status::getChoices ( ) const

Returns an unmodifiable list of next turns that this role can take next in the session.

This list will be empty if the story had ended or if it is not this role's turn to act.

Returns
a vector of available next turns

◆ getDescriptions()

const std::vector< const Entity * > & tt::Status::getDescriptions ( ) const

Returns an unmodifiable list of all the entities that this role can currently see.

Each one will have a natural language description that gives some helpful context about it. Note that not all entities in the story world will be in this list; if an entity cannot be seen it is excluded.

Returns
a vector of all visible entities and their descriptions

◆ getEnding()

const Ending * tt::Status::getEnding ( ) const

Returns the ending the session's story has reached, or null if the story has not yet ended.

Returns
the story's ending, or null if it has not ended

◆ getHistory()

const std::vector< const Turn * > & tt::Status::getHistory ( ) const

Returns an unmodifiable list of all turns that have happened so far in the session.

Returns
a vector of turns

◆ getState()

const State * tt::Status::getState ( ) const

Returns a state that gives the current value of all the story world's variables.

Returns
the current state of the story world

◆ toString()

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

Returns a string representation of this object.

Returns
a string describing this object

◆ operator<<

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

Override stream insertion operator to allow printing the Status class.

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

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