Class Status

java.lang.Object
edu.uky.cs.nil.tt.world.Status

public class Status extends Object
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:
Stephen G. Ware
  • Field Details

    • role

      public final Role role
      The role of the participant to whom this status is being described
  • Constructor Details

    • Status

      public Status(String world, Role role, Turn[] history, State state, Ending ending, Entity[] descriptions, Turn[] choices)
      Constructs a status.
      Parameters:
      world - the name of the story world being used in this session
      role - the role to whom this status is being sent and for whom the descriptions are being generated
      history - all turns that have happened so far in the session
      state - the current value of all of the story world's variables
      ending - the ending this session's story has reached, or null if no ending has been reached
      descriptions - the entities that are currently visible to the role
      choices - the turns this role can take next (which may be none)
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getHistory

      public List<Turn> getHistory()
      Returns an unmodifiable list of all turns that have happened so far in the session.
      Returns:
      a list of turns
    • getState

      public State getState()
      Returns a state that gives the current value of all the story world's variables.
      Returns:
      the current state of the story world
    • getEnding

      public Ending getEnding()
      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
    • getDescriptions

      public List<Entity> getDescriptions()
      Returns an unmodifiable list of all the entities that this role can current 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 list of all visible entities and their descriptions
    • getChoices

      public List<Turn> getChoices()
      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 list of available next turns