org.vizzini.game
Interface IEnvironment

All Superinterfaces:
Cloneable, Serializable
All Known Subinterfaces:
IArcadeEnvironment, IChessEnvironment, IGridBoard, ISimulationEnvironment
All Known Implementing Classes:
AbstractArcadeEnvironment, AbstractCardTable, AbstractChessEnvironment, AbstractEnvironment, AbstractGridBoard, AbstractSimulationEnvironment, DefaultChessEnvironment, DefaultEnvironment, DefaultGridBoard, DefaultSimulationEnvironment, Environment, Environment

public interface IEnvironment
extends Cloneable, Serializable

Defines methods required by environments in the game framework. An environment instance encapsulates the environment in which actions occur in a game, and tracks the effects of those actions. Examples of environments include a chess board, a card table, or deep space.

Since:
v0.1
Version:
v0.3
Author:
Jeffrey M. Thompson

Method Summary
 void addStateListener(IStateListener listener)
          Add the given listener.
 Object clone()
          Return a clone of this instance.
 void configure(Properties properties)
          Configure this environment.
 void copy(IEnvironment environment)
          Copy data from the given instance into this.
 IToken get(IPosition position)
          Return the token at the given position.
 IAdjudicator getAdjudicator()
          Return the adjudicator.
 IAgentCollection getAgentCollection()
          Return the agent collection.
 ITeamCollection getTeamCollection()
          Return the team collection.
 ITokenCollection getTokenCollection()
          Return the token collection.
 long getTurnNumber()
          Return the current turn number.
 void incrementTurnNumber()
          Increment the turn number.
 boolean isFiringStateChanges()
          Return true if this is set to fire state change events.
 void open(IGameState gameState)
          Open the game contained in the given game state.
 void performAction(IAction action)
          Perform the given action.
 void performActions(Collection actions)
          Perform the actions in the given list.
 void removeStateListener(IStateListener listener)
          Remove the given listener.
 void reset()
          Reset to the initial state.
 void setAdjudicator(IAdjudicator adjudicator)
          Set the adjudicator.
 void setAgentCollection(IAgentCollection agentCollection)
          Set the agent collection.
 void setFiringStateChanges(boolean fire)
          Set the flag which indicates whether to fire state change events.
 void setTurnNumber(long turnNumber)
          Set the turn number to the given value.
 void undoAction(IAction action)
          Undo the given action.
 void update(long deltaTime)
          Update the environment for the given elapsed time.
 

Method Detail

addStateListener

void addStateListener(IStateListener listener)
Add the given listener.

Since:
v0.1

clone

Object clone()
Return a clone of this instance.

Since:
v0.1

configure

void configure(Properties properties)
               throws InstantiationException,
                      IllegalAccessException
Configure this environment.

Parameters:
properties - Source of configuration information.
Throws:
InstantiationException
IllegalAccessException
Since:
v0.1

copy

void copy(IEnvironment environment)
Copy data from the given instance into this.

Parameters:
environment - Environment from which to copy data.
Since:
v0.1

get

IToken get(IPosition position)
Return the token at the given position.

Since:
v0.2

getAdjudicator

IAdjudicator getAdjudicator()
Return the adjudicator.

Since:
v0.1

getAgentCollection

IAgentCollection getAgentCollection()
Return the agent collection.

Since:
v0.1

getTeamCollection

ITeamCollection getTeamCollection()
Return the team collection.

Since:
v0.1

getTokenCollection

ITokenCollection getTokenCollection()
Return the token collection.

Since:
v0.1

getTurnNumber

long getTurnNumber()
Return the current turn number.

Since:
v0.1

incrementTurnNumber

void incrementTurnNumber()
Increment the turn number.

Since:
v0.1

isFiringStateChanges

boolean isFiringStateChanges()
Return true if this is set to fire state change events.

Since:
v0.2

open

void open(IGameState gameState)
Open the game contained in the given game state.

Since:
v0.1

performAction

void performAction(IAction action)
Perform the given action.

Parameters:
action - Action.
Since:
v0.1

performActions

void performActions(Collection actions)
Perform the actions in the given list.

Parameters:
actions - List of actions.
Since:
v0.1

removeStateListener

void removeStateListener(IStateListener listener)
Remove the given listener.

Since:
v0.1

reset

void reset()
Reset to the initial state.

Since:
v0.1

setAdjudicator

void setAdjudicator(IAdjudicator adjudicator)
Set the adjudicator.

Parameters:
adjudicator - The new adjudicator.
Since:
v0.1

setAgentCollection

void setAgentCollection(IAgentCollection agentCollection)
Set the agent collection.

Parameters:
agentCollection - New agent collection.
Since:
v0.1

setFiringStateChanges

void setFiringStateChanges(boolean fire)
Set the flag which indicates whether to fire state change events.

Since:
v0.1

setTurnNumber

void setTurnNumber(long turnNumber)
Set the turn number to the given value.

Since:
v0.1

undoAction

void undoAction(IAction action)
Undo the given action.

Parameters:
action - Action.
Since:
v0.1

update

void update(long deltaTime)
Update the environment for the given elapsed time.

Parameters:
deltaTime - Delta time per cycle. (ms)
Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02