com.jmex.game.state
Class GameStateManager

java.lang.Object
  extended by com.jmex.game.state.GameState
      extended by com.jmex.game.state.GameStateNode<GameState>
          extended by com.jmex.game.state.GameStateManager

public class GameStateManager
extends GameStateNode<GameState>

GameStateManager is nothing more than a singleton GameStateNode. It should be the root of the GameState "tree".

Author:
Per Thulin
See Also:
GameStateNode, GameState

Field Summary
 
Fields inherited from class com.jmex.game.state.GameStateNode
children
 
Fields inherited from class com.jmex.game.state.GameState
active, name, parent
 
Method Summary
static GameStateManager create()
          Creates a new GameStateManager.
static GameStateManager getInstance()
          Returns the singleton instance of this class.
 
Methods inherited from class com.jmex.game.state.GameStateNode
activateAllChildren, activateChildNamed, attachChild, cleanup, deactivateAllChildren, deactivateChildNamed, detachAllChildren, detachChild, detachChild, detachChild, getChild, getChild, getChildren, getQuantity, hasChild, render, update
 
Methods inherited from class com.jmex.game.state.GameState
getName, getParent, isActive, setActive, setName, setParent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static GameStateManager create()
Creates a new GameStateManager.

Returns:
If this is the first time create() is called, a new instance will be created and returned. Otherwise one should use getInstance() instead.

getInstance

public static GameStateManager getInstance()
Returns the singleton instance of this class. Note that create() has to have been called before this.

Returns:
The singleton.