gecco.game.testgame
Class AutomatonImpl

java.lang.Object
  |
  +--gecco.server.automaton.Automaton
        |
        +--gecco.game.testgame.AutomatonImpl

public class AutomatonImpl
extends Automaton

Description of the Class


Field Summary
(package private) static String FIRE
          Description of the Field
 
Fields inherited from class gecco.server.automaton.Automaton
changed, currentColor, currentState
 
Constructor Summary
AutomatonImpl()
           
 
Method Summary
private  boolean checkNeighbourstatesForState(int[][] neighbourStates, int checkState)
          Description of the Method
private  AutomatonReturn fireReturn(int[][] neighbourStates)
          Description of the Method
 UnitEvent getUnitEventForCurrentState(String unitType)
          Gets the UnitEventForCurrentState attribute of the AutomatonImpl object
 AutomatonReturn handleEvent(AutomatonEvent event)
          Description of the Method
 void initialize(int initialState)
          Description of the Method
private  void setColor(int state)
          Sets the Color attribute of the AutomatonImpl object
 AutomatonReturn update(int[][] neighourStates)
          Description of the Method
 
Methods inherited from class gecco.server.automaton.Automaton
getCurrentColor, getState, hasChanged, setCurrentColor, setState
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

FIRE

static final String FIRE
Description of the Field
Constructor Detail

AutomatonImpl

public AutomatonImpl()
Method Detail

getUnitEventForCurrentState

public UnitEvent getUnitEventForCurrentState(String unitType)
Gets the UnitEventForCurrentState attribute of the AutomatonImpl object
Overrides:
getUnitEventForCurrentState in class Automaton
Parameters:
unitType - Description of Parameter
Returns:
The UnitEventForCurrentState value

initialize

public void initialize(int initialState)
Description of the Method
Overrides:
initialize in class Automaton
Parameters:
initialState - Description of Parameter

update

public AutomatonReturn update(int[][] neighourStates)
Description of the Method
Overrides:
update in class Automaton
Parameters:
neighourStates - Description of Parameter
Returns:
Description of the Returned Value

handleEvent

public AutomatonReturn handleEvent(AutomatonEvent event)
Description of the Method
Overrides:
handleEvent in class Automaton
Parameters:
event - Description of Parameter
Returns:
Description of the Returned Value

setColor

private void setColor(int state)
Sets the Color attribute of the AutomatonImpl object
Parameters:
state - The new Color value

fireReturn

private AutomatonReturn fireReturn(int[][] neighbourStates)
Description of the Method
Parameters:
neighbourStates - Description of Parameter
Returns:
Description of the Returned Value

checkNeighbourstatesForState

private boolean checkNeighbourstatesForState(int[][] neighbourStates,
                                             int checkState)
Description of the Method
Parameters:
neighbourStates - Description of Parameter
checkState - Description of Parameter
Returns:
Description of the Returned Value