|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.huguesjohnson.tiamat.GameData
public class GameData
GameData - contains global data for a game
Field Summary | |
---|---|
protected java.lang.String |
absoluteDir
Absolute path to the directory where characters are saved. |
Constructor Summary | |
---|---|
GameData()
|
Method Summary | |
---|---|
void |
addCharacter(java.lang.String characterPath,
Formatter formatter)
Adds a Character to this game. |
ItemCollection |
getAvailableItems()
Returns an ItemCollection representing all Items available in the game. |
Character |
getCharacter(java.lang.String name)
Returns the character with the specified name. |
java.lang.String[] |
getCharacterPaths()
Returns a list of all relative paths to Charaters. |
Character[] |
getCharacters()
Returns all the Charaters available in this game. |
Item |
getItem(java.lang.String path)
Returns the Item with the specified name if it exists, otherwise null. |
GameScript |
getScript()
Returns the script for this game. |
void |
onDeserialize(Formatter formatter,
java.lang.String absoluteDir)
The onDeserialize event should be fired after an object is de-serialized. |
void |
setAbsoluteDir(java.lang.String absoluteDir)
Sets the absolute path to the directory where characters are saved. |
void |
setAvailableItems(ItemCollection availableItems)
Sets the collection of all Items available in the game. |
void |
setCharacters(java.lang.String[] characterPaths,
Formatter formatter)
Sets the Characters for this game. |
void |
setScript(GameScript script)
Sets the script for this game. |
void |
setScript(java.lang.String scriptPath,
Formatter formatter)
Loads the script for this game. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient java.lang.String absoluteDir
Constructor Detail |
---|
public GameData()
Method Detail |
---|
public ItemCollection getAvailableItems()
public void setAvailableItems(ItemCollection availableItems)
availableItems
- The collection of all Items available in the game.public GameScript getScript()
public void setScript(GameScript script)
script
- The script for this game.public void setScript(java.lang.String scriptPath, Formatter formatter)
scriptPath
- The path to the script file.formatter
- The formatter to use to deserialize the Characters.public Character[] getCharacters()
public java.lang.String[] getCharacterPaths()
public void setCharacters(java.lang.String[] characterPaths, Formatter formatter)
characterPaths
- The paths to the Character files.formatter
- The formatter to use to deserialize the Characters.public void addCharacter(java.lang.String characterPath, Formatter formatter)
characterPath
- The path to the Character file.formatter
- The formatter to use to deserialize the Characters.public void setAbsoluteDir(java.lang.String absoluteDir)
absoluteDir
- The absolute path to the directory where characters are saved.public Character getCharacter(java.lang.String name)
name
- The name of the character to search for.
public Item getItem(java.lang.String path)
path
- The name of the Item to retreive.
public void onDeserialize(Formatter formatter, java.lang.String absoluteDir)
onDeserialize
in interface Storable
formatter
- the formatter to use to load any storable membersabsoluteDir
- the working directory since all paths stored in the object should be relative
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |