|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.huguesjohnson.tiamat.GameDataManager
public class GameDataManager
GameDataManager.java - manages global data for a game
| Field Summary | |
|---|---|
protected java.lang.String |
absoluteDir
Absolute path to the directory where objects are saved. |
| Constructor Summary | |
|---|---|
GameDataManager()
Creates a new instance of GameDataManager. |
|
| Method Summary | |
|---|---|
void |
addCharacter(java.lang.String name,
java.lang.String absoluteCharacterPath)
Add a Character to the game data. |
void |
addItem(java.lang.String name,
java.lang.String absoluteItemPath)
Add an Item to the game data. |
void |
addLocation(java.lang.String name,
java.lang.String absoluteLocationPath)
Add a Location to the game data. |
void |
addSequence(java.lang.String name,
java.lang.String absoluteLocationPath)
Add a Sequence to the game data. |
Character |
getCharacter(java.lang.String name,
Formatter formatter)
Retrieve (deserialize) a Character by name. |
Item |
getItem(java.lang.String name,
Formatter formatter)
Retrieve an Item by name. |
Location |
getLocation(java.lang.String name,
Formatter formatter)
Retrieve a Location by name. |
Sequence |
getSequence(java.lang.String name,
Formatter formatter)
Retrieve a Sequence by name. |
void |
onDeserialize(Formatter formatter,
java.lang.String absoluteDir)
The onDeserialize event should be fired after an object is de-serialized. |
void |
saveCharacter(java.lang.String name,
Character character,
Formatter formatter)
Save (serialize) a character. |
void |
saveItem(java.lang.String name,
Item item,
Formatter formatter)
Save (serialize) an Item. |
void |
saveLocation(java.lang.String name,
Location location,
Formatter formatter)
Save (serialize) a Location. |
void |
saveSequence(java.lang.String name,
Sequence sequence,
Formatter formatter)
Save (serialize) a Sequence. |
void |
setAbsoluteDir(java.lang.String absoluteDir)
Sets the absolute path to the directory where objects are saved. |
| 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 GameDataManager()
| Method Detail |
|---|
public void setAbsoluteDir(java.lang.String absoluteDir)
absoluteDir - The absolute path to the directory where characters are saved.
public void addCharacter(java.lang.String name,
java.lang.String absoluteCharacterPath)
name - The name of the Character to add.absoluteCharacterPath - The absolute path to the Character file.
public Character getCharacter(java.lang.String name,
Formatter formatter)
name - The name of the Character to retrieve.formatter - The formatter to use to load the Character.
public void saveCharacter(java.lang.String name,
Character character,
Formatter formatter)
name - The name of the Character to save.character - The actual Character object to save.formatter - The formatter to use to save the Character.
public void addItem(java.lang.String name,
java.lang.String absoluteItemPath)
name - The name of the Item to add.absoluteItemPath - The absolute path to the Item file.
public Item getItem(java.lang.String name,
Formatter formatter)
name - The name of the Item to retrieve.formatter - The formatter to use to load the Item.
public void saveItem(java.lang.String name,
Item item,
Formatter formatter)
name - The name of the Item to save.item - The actual Item object to save.formatter - The formatter to use to save the Item.
public void addLocation(java.lang.String name,
java.lang.String absoluteLocationPath)
name - The name of the Location to add.absoluteLocationPath - The absolute path to the Location file.
public Location getLocation(java.lang.String name,
Formatter formatter)
name - The name of the Location to retrieve.formatter - The formatter to use to load the Location.
public void saveLocation(java.lang.String name,
Location location,
Formatter formatter)
name - The name of the Location to save.location - The actual Location object to save.formatter - The formatter to use to save the Location.
public void addSequence(java.lang.String name,
java.lang.String absoluteLocationPath)
name - The name of the Sequence to add.absoluteLocationPath - The absolute path to the Sequence file.
public Sequence getSequence(java.lang.String name,
Formatter formatter)
name - The name of the Sequence to retrieve.formatter - The formatter to use to load the Sequence.
public void saveSequence(java.lang.String name,
Sequence sequence,
Formatter formatter)
name - The name of the Sequence to save.sequence - The actual Sequence object to save.formatter - The formatter to use to save the Sequence.
public void onDeserialize(Formatter formatter,
java.lang.String absoluteDir)
Storable
onDeserialize in interface Storableformatter - 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 | |||||||