|
||||||||||
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 IEnvironment
public Object clone()
clone
in interface IEnvironment
clone
in class Object
public void configure(Properties properties) throws InstantiationException, IllegalAccessException
configure
in interface IEnvironment
properties
- Source of configuration information.
InstantiationException
IllegalAccessException
public void copy(IEnvironment environment)
copy
in interface IEnvironment
environment
- Environment from which to copy data.public boolean equals(Object object)
equals
in class Object
object
- The object to compare.public IToken get(IPosition position)
get
in interface IEnvironment
public IAdjudicator getAdjudicator()
getAdjudicator
in interface IEnvironment
public IAgentCollection getAgentCollection()
getAgentCollection
in interface IEnvironment
public ITeamCollection getTeamCollection()
getTeamCollection
in interface IEnvironment
public ITokenCollection getTokenCollection()
getTokenCollection
in interface IEnvironment
public long getTurnNumber()
getTurnNumber
in interface IEnvironment
public int hashCode()
hashCode
in class Object
public void incrementTurnNumber()
incrementTurnNumber
in interface IEnvironment
public boolean isFiringStateChanges()
isFiringStateChanges
in interface IEnvironment
public void open(IGameState gameState)
open
in interface IEnvironment
public void performActions(Collection actions)
performActions
in interface IEnvironment
actions
- List of actions.public void removeStateListener(IStateListener listener)
removeStateListener
in interface IEnvironment
public void reset()
reset
in interface IEnvironment
public void setAdjudicator(IAdjudicator adjudicator)
setAdjudicator
in interface IEnvironment
adjudicator
- The new adjudicator.public void setAgentCollection(IAgentCollection agentCollection)
setAgentCollection
in interface IEnvironment
agentCollection
- New agent collection.public void setFiringStateChanges(boolean fire)
setFiringStateChanges
in interface IEnvironment
public void setTurnNumber(long turnNumber)
setTurnNumber
in interface IEnvironment
public void update(long deltaTime)
update
in interface IEnvironment
deltaTime
- Delta time per cycle. (ms)protected ITokenCollection createInitialTokens() throws InstantiationException, IllegalAccessException
InstantiationException
IllegalAccessException
protected 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 |