org.vizzini.game
Interface IEngine

All Known Implementing Classes:
AbstractEngine, AsynchronousEngine, Engine, SynchronousEngine

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.

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

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

addGameListener

void addGameListener(IGameListener listener)
Add the given listener.

Since:
v0.1

configure

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

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

getCurrentAgent

IAgent getCurrentAgent()
Return the current agent.

Since:
v0.1

getEnvironment

IEnvironment getEnvironment()
Return the environment.

Since:
v0.1

getMinCycleTime

long getMinCycleTime()
Return the minimum cycle time.

Since:
v0.3

isFiringGameChanges

boolean isFiringGameChanges()
Return true if this is set to fire game change events.

Since:
v0.3

isGameOver

boolean isGameOver()
Return true if the game is over.

Since:
v0.1

isPaused

boolean isPaused()
Return true if this is paused.

Since:
v0.1

pause

void pause()
Pause the engine.

Since:
v0.1

removeGameListener

void removeGameListener(IGameListener listener)
Remove the given listener.

Since:
v0.1

reset

void reset()
Reset to the initial state.

Since:
v0.1

resume

void resume()
Resume the engine from a pause.

Since:
v0.1

run

void run()
Perform the game loop actions.

Since:
v0.1

setEnvironment

void setEnvironment(IEnvironment environment)
Set the environment to the given value.

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

setFiringGameChanges

void setFiringGameChanges(boolean fire)
Set the flag which indicates whether to fire game change events.

Since:
v0.3

setGameOver

void setGameOver(boolean isGameOver,
                 IAgent winner)
Set the game over flag to the given value.

Parameters:
isGameOver - The new value.
Since:
v0.1

setMinCycleTime

void setMinCycleTime(long minCycleTime)
Set the minimum cycle time.

Since:
v0.1

start

void start()
Start the engine.

Since:
v0.1

step

void step()
Step the engine.

Since:
v0.1


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02