Class GameState
java.lang.Object
nz.ac.vuw.ecs.swen225.gp22.recorder.GameState
The game state class to store the game state.
- Author:
- Chris
-
Constructor Details
-
GameState
protected GameState(int id, int time) Create a new game state.- Parameters:
id
- the id of the game statetime
- the time of the game state
-
GameState
Add an action to the game state.- Parameters:
id
- the id of the actiontime
- the time of the actionactions
- the actions to add
-
-
Method Details
-
addAction
Add an action to the game state.- Parameters:
action
- The action to add.
-
getTime
public int getTime()Get the time of the game state.- Returns:
- The time of the game state.
-
apply
Apply this game state.- Parameters:
base
- the base to call the apply method on
-
undo
Undo this game state.- Parameters:
base
- the base to call the undo method on
-
toxml
public org.dom4j.Element toxml()Convert the game state to xml.- Returns:
- The xml element of the game state.
-