|
||||||||||
| 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 IGameInstantiationException
IllegalAccessException
public void configure(Properties properties)
throws InstantiationException,
IllegalAccessException
configure in interface IGameproperties - Source of configuration information.
InstantiationException
IllegalAccessExceptionpublic IAdjudicator getAdjudicator()
getAdjudicator in interface IGamepublic IEngine getEngine()
getEngine in interface IGamepublic IEnvironment getEnvironment()
getEnvironment in interface IGamepublic String getGameIdentifier()
getGameIdentifier in interface IGamepublic IGameState getGameState()
getGameState in interface IGamepublic Properties getProperties()
getProperties in interface IGamepublic String getPropertiesPath()
getPropertiesPath in interface IGame
public void open(File file)
throws FileNotFoundException,
IOException,
ClassNotFoundException
open in interface IGameFileNotFoundException
IOException
ClassNotFoundExceptionpublic void reset()
reset in interface IGame
public void save()
throws FileNotFoundException,
IOException
save in interface IGameFileNotFoundException
IOException
public void saveAs(File file)
throws FileNotFoundException,
IOException
saveAs in interface IGameFileNotFoundException
IOExceptionpublic void setPropertiesPath(String propertiesPath)
setPropertiesPath in interface IGamepublic void start()
start in interface IGamepublic 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 |