de.rico.adventure.structure
Class StateManager

java.lang.Object
  extended by de.rico.adventure.structure.StateManager

public class StateManager
extends java.lang.Object

This is a class that reflects the current game state. It implements the singleton pattern.

Author:
Frank Bruns

Method Summary
 boolean equals(State state)
          Determins whether the current gamestate is equal to the specified one
static StateManager getInstance()
          Returns the singleton instance of the state manager
 State getState()
          Returns the current game state
 void setState(State state)
          Sets the current game state to the specified state from the State enumeration
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static StateManager getInstance()
Returns the singleton instance of the state manager

Returns:
the state manager instance

setState

public void setState(State state)
Sets the current game state to the specified state from the State enumeration

Parameters:
state - new game state

getState

public State getState()
Returns the current game state

Returns:
current game state that is set

equals

public boolean equals(State state)
Determins whether the current gamestate is equal to the specified one

Parameters:
state - the state to compare for equality
Returns:
is state equal to current state? --> true=yes, false=no