|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.vizzini.game.AbstractEnvironment
public abstract class AbstractEnvironment
Provides base functionality for 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.
| Constructor Summary | |
|---|---|
AbstractEnvironment()
Construct this object with no agents. |
|
AbstractEnvironment(AbstractEnvironment another)
Copy constructor. |
|
| 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. |
protected ITokenCollection |
createInitialTokens()
Create the initial tokens from the cached properties. |
boolean |
equals(Object object)
Return true if the given object is equal to this. |
IToken |
get(IPosition position)
Return the token at the given position. |
IAdjudicator |
getAdjudicator()
Return the adjudicator. |
IAgentCollection |
getAgentCollection()
Return the agent collection. |
protected StateManager |
getStateManager()
Return the state manager. |
ITeamCollection |
getTeamCollection()
Return the team collection. |
ITokenCollection |
getTokenCollection()
Return the token collection. |
protected Class |
getTokenCollectionClass()
|
long |
getTurnNumber()
Return the current turn number. |
int |
hashCode()
Returns a hash code value for the object. |
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 |
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. |
protected void |
setTokenCollectionClass(Class tokenCollectionClass)
|
void |
setTurnNumber(long turnNumber)
Set the turn number to the given value. |
void |
update(long deltaTime)
Update the environment for the given elapsed time. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.vizzini.game.IEnvironment |
|---|
performAction, undoAction |
| Constructor Detail |
|---|
public AbstractEnvironment()
public AbstractEnvironment(AbstractEnvironment another)
another - The environment from which to copy.| Method Detail |
|---|
public void addStateListener(IStateListener listener)
addStateListener in interface IEnvironmentpublic Object clone()
clone in interface IEnvironmentclone in class Object
public void configure(Properties properties)
throws InstantiationException,
IllegalAccessException
configure in interface IEnvironmentproperties - Source of configuration information.
InstantiationException
IllegalAccessExceptionpublic void copy(IEnvironment environment)
copy in interface IEnvironmentenvironment - Environment from which to copy data.public boolean equals(Object object)
equals in class Objectobject - The object to compare.public IToken get(IPosition position)
get in interface IEnvironmentpublic IAdjudicator getAdjudicator()
getAdjudicator in interface IEnvironmentpublic IAgentCollection getAgentCollection()
getAgentCollection in interface IEnvironmentpublic ITeamCollection getTeamCollection()
getTeamCollection in interface IEnvironmentpublic ITokenCollection getTokenCollection()
getTokenCollection in interface IEnvironmentpublic long getTurnNumber()
getTurnNumber in interface IEnvironmentpublic int hashCode()
hashCode in class Objectpublic void incrementTurnNumber()
incrementTurnNumber in interface IEnvironmentpublic boolean isFiringStateChanges()
isFiringStateChanges in interface IEnvironmentpublic void open(IGameState gameState)
open in interface IEnvironmentpublic void performActions(Collection actions)
performActions in interface IEnvironmentactions - List of actions.public void removeStateListener(IStateListener listener)
removeStateListener in interface IEnvironmentpublic void reset()
reset in interface IEnvironmentpublic void setAdjudicator(IAdjudicator adjudicator)
setAdjudicator in interface IEnvironmentadjudicator - The new adjudicator.public void setAgentCollection(IAgentCollection agentCollection)
setAgentCollection in interface IEnvironmentagentCollection - New agent collection.public void setFiringStateChanges(boolean fire)
setFiringStateChanges in interface IEnvironmentpublic void setTurnNumber(long turnNumber)
setTurnNumber in interface IEnvironmentpublic void update(long deltaTime)
update in interface IEnvironmentdeltaTime - Delta time per cycle. (ms)
protected ITokenCollection createInitialTokens()
throws InstantiationException,
IllegalAccessException
InstantiationException
IllegalAccessExceptionprotected StateManager getStateManager()
protected Class getTokenCollectionClass()
protected void setTokenCollectionClass(Class tokenCollectionClass)
tokenCollectionClass - The tokenCollectionClass to set.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
| Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |