|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.vizzini.game.AbstractGame
public abstract class AbstractGame
Provides base functionality for games in the game framework. A game instance assembles the appropriate pieces to create a full game. These pieces consist of an engine, an environment, and an adjudicator.
Constructor Summary | |
---|---|
AbstractGame()
|
Method Summary | |
---|---|
void |
configure()
Configure this game. |
void |
configure(Properties properties)
Configure this game. |
protected IEngine |
createEngine(Properties properties)
Create the engine. |
protected IGameState |
createGameState(Properties properties)
Create the game state. |
IAdjudicator |
getAdjudicator()
Return the adjudicator. |
IEngine |
getEngine()
Return the engine. |
IEnvironment |
getEnvironment()
Return the environment. |
String |
getGameIdentifier()
Return the game identifier. |
IGameState |
getGameState()
Return the game state. |
Properties |
getProperties()
Return the configuration properties. |
String |
getPropertiesPath()
Return the path to the game properties. |
protected void |
loadProperties(Properties properties,
String filepath)
Load the given properties object from the given filepath. |
void |
open(File file)
Open the game contained in the given file. |
void |
reset()
Reset to the initial state. |
void |
save()
Save the current game. |
void |
saveAs(File file)
Save the current game to the given file. |
void |
setPropertiesPath(String propertiesPath)
Set the path to the game properties. |
void |
start()
Start the game. |
void |
stop()
Stop the game. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractGame()
Method Detail |
---|
public void configure() throws InstantiationException, IllegalAccessException
configure
in interface IGame
InstantiationException
IllegalAccessException
public void configure(Properties properties) throws InstantiationException, IllegalAccessException
configure
in interface IGame
properties
- Source of configuration information.
InstantiationException
IllegalAccessException
public IAdjudicator getAdjudicator()
getAdjudicator
in interface IGame
public IEngine getEngine()
getEngine
in interface IGame
public IEnvironment getEnvironment()
getEnvironment
in interface IGame
public String getGameIdentifier()
getGameIdentifier
in interface IGame
public IGameState getGameState()
getGameState
in interface IGame
public Properties getProperties()
getProperties
in interface IGame
public String getPropertiesPath()
getPropertiesPath
in interface IGame
public void open(File file) throws FileNotFoundException, IOException, ClassNotFoundException
open
in interface IGame
FileNotFoundException
IOException
ClassNotFoundException
public void reset()
reset
in interface IGame
public void save() throws FileNotFoundException, IOException
save
in interface IGame
FileNotFoundException
IOException
public void saveAs(File file) throws FileNotFoundException, IOException
saveAs
in interface IGame
FileNotFoundException
IOException
public void setPropertiesPath(String propertiesPath)
setPropertiesPath
in interface IGame
public void start()
start
in interface IGame
public void stop()
stop
in interface IGame
protected IEngine createEngine(Properties properties) throws InstantiationException, IllegalAccessException
properties
- Source of engine information.
InstantiationException
IllegalAccessException
protected IGameState createGameState(Properties properties) throws InstantiationException, IllegalAccessException
properties
- Source of game state information.
InstantiationException
IllegalAccessException
protected void loadProperties(Properties properties, String filepath)
properties
- Properties object to load.filepath
- Source filepath.
|
||||||||||
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 |