|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IEngine
Defines methods required by engines in the game framework. An engine instance encapsulates the game mechanics, meaning how the agents interact. Examples of engines include a synchronous engine, where agents take turns, a simultaneous engine, where the agent's actions occur at the same time, or an asynchronous engine, where the agent's actions occur at any time and any amount.
Method Summary | |
---|---|
void |
addGameListener(IGameListener listener)
Add the given listener. |
void |
configure(Properties properties)
Configure this engine. |
IAgent |
getCurrentAgent()
Return the current agent. |
IEnvironment |
getEnvironment()
Return the environment. |
long |
getMinCycleTime()
Return the minimum cycle time. |
boolean |
isFiringGameChanges()
Return true if this is set to fire game change events. |
boolean |
isGameOver()
Return true if the game is over. |
boolean |
isPaused()
Return true if this is paused. |
void |
pause()
Pause the engine. |
void |
removeGameListener(IGameListener listener)
Remove the given listener. |
void |
reset()
Reset to the initial state. |
void |
resume()
Resume the engine from a pause. |
void |
run()
Perform the game loop actions. |
void |
setEnvironment(IEnvironment environment)
Set the environment to the given value. |
void |
setFiringGameChanges(boolean fire)
Set the flag which indicates whether to fire game change events. |
void |
setGameOver(boolean isGameOver,
IAgent winner)
Set the game over flag to the given value. |
void |
setMinCycleTime(long minCycleTime)
Set the minimum cycle time. |
void |
start()
Start the engine. |
void |
step()
Step the engine. |
Method Detail |
---|
void addGameListener(IGameListener listener)
void configure(Properties properties) throws InstantiationException, IllegalAccessException
properties
- Source of configuration information.
InstantiationException
IllegalAccessException
IAgent getCurrentAgent()
IEnvironment getEnvironment()
long getMinCycleTime()
boolean isFiringGameChanges()
boolean isGameOver()
boolean isPaused()
void pause()
void removeGameListener(IGameListener listener)
void reset()
void resume()
void run()
void setEnvironment(IEnvironment environment)
environment
- The new environment.void setFiringGameChanges(boolean fire)
void setGameOver(boolean isGameOver, IAgent winner)
isGameOver
- The new value.void setMinCycleTime(long minCycleTime)
void start()
void step()
|
||||||||||
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 |