com.huguesjohnson.tiamat
Class BaseGameState

java.lang.Object
  extended by com.huguesjohnson.tiamat.BaseGameState
All Implemented Interfaces:
Storable

public abstract class BaseGameState
extends java.lang.Object
implements Storable

BaseGameState - base game state

Author:
Hugues Johnson

Constructor Summary
BaseGameState()
          Creates an empty BaseGameState.
BaseGameState(java.lang.String[] conditions)
          Creates a BaseGameState with conditions.
 
Method Summary
 void addCondition(java.lang.String condition)
          Add a condition (something that has happened in the game).
 java.lang.String[] getConditions()
          Returns all conditions (things that have happened in the game).
 boolean hasCondition(java.lang.String condition)
          Tests if a specific condition has occured.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.huguesjohnson.serialization.Storable
onDeserialize
 

Constructor Detail

BaseGameState

public BaseGameState()
Creates an empty BaseGameState.


BaseGameState

public BaseGameState(java.lang.String[] conditions)
Creates a BaseGameState with conditions.

Parameters:
conditions - The initial conditions for this BaseGameState.
Method Detail

addCondition

public void addCondition(java.lang.String condition)
Add a condition (something that has happened in the game).

Parameters:
condition - The condition to add.

getConditions

public java.lang.String[] getConditions()
Returns all conditions (things that have happened in the game).

Returns:
A string array of all conditions (things that have happened in the game).

hasCondition

public boolean hasCondition(java.lang.String condition)
Tests if a specific condition has occured.

Parameters:
condition - The condition to search for.
Returns:
True if the specified condition has occured.


Copyright © 2004-2006 Hugues Johnson