gecco.game.oresund
Class AutomatonImpl

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

public class AutomatonImpl
extends Automaton

Description of the Class


Field Summary
(package private) static int BRIDGE
          Description of the Field
(package private) static String BRIDGE_EVENT_STRING
          Description of the Field
(package private) static int CITY
          Description of the Field
(package private) static String CITY_EVENT_STRING
          Description of the Field
(package private) static int FOREST
          Description of the Field
(package private) static String FOREST_EVENT_STRING
          Description of the Field
(package private) static int LAND
          Description of the Field
(package private) static String LAND_EVENT_STRING
          Description of the Field
(package private) static HashMap stateToColour
          Description of the Field
(package private) static int SURVIVOR
          Description of the Field
(package private) static String SURVIVOR_EVENT_STRING
          Description of the Field
(package private) static int WATER
          Description of the Field
(package private) static String WATER_EVENT_STRING
          Description of the Field
 
Fields inherited from class gecco.server.automaton.Automaton
changed, currentColor, currentState
 
Constructor Summary
AutomatonImpl()
           
 
Method Summary
(package private) static void ()
           
private  boolean existsNeighboursWithState(int[][] neighbourStates, int state)
          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 setColour(int state)
          Sets the Colour attribute of the AutomatonImpl object
 AutomatonReturn update(int[][] neighbourStates)
          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

CITY_EVENT_STRING

static final String CITY_EVENT_STRING
Description of the Field

SURVIVOR_EVENT_STRING

static final String SURVIVOR_EVENT_STRING
Description of the Field

WATER_EVENT_STRING

static final String WATER_EVENT_STRING
Description of the Field

FOREST_EVENT_STRING

static final String FOREST_EVENT_STRING
Description of the Field

LAND_EVENT_STRING

static final String LAND_EVENT_STRING
Description of the Field

BRIDGE_EVENT_STRING

static final String BRIDGE_EVENT_STRING
Description of the Field

CITY

static final int CITY
Description of the Field

SURVIVOR

static final int SURVIVOR
Description of the Field

WATER

static final int WATER
Description of the Field

FOREST

static final int FOREST
Description of the Field

LAND

static final int LAND
Description of the Field

BRIDGE

static final int BRIDGE
Description of the Field

stateToColour

static final HashMap stateToColour
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)
                throws IllegalArgumentException
Description of the Method
Overrides:
initialize in class Automaton
Parameters:
initialState - Description of Parameter
Throws:
IllegalArgumentException - Description of Exception

update

public AutomatonReturn update(int[][] neighbourStates)
Description of the Method
Overrides:
update in class Automaton
Parameters:
neighbourStates - 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

setColour

private void setColour(int state)
                throws IllegalArgumentException
Sets the Colour attribute of the AutomatonImpl object
Parameters:
state - The new Colour value
Throws:
IllegalArgumentException - Description of Exception

existsNeighboursWithState

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

static void ()