jurpe.system.commands
Class PersistenceCommands

java.lang.Object
  extended by jurpe.system.commands.GenericCommands
      extended by jurpe.system.commands.PersistenceCommands

public class PersistenceCommands
extends GenericCommands

Persistence related commands.

See Also:
CoreCommands

Constructor Summary
PersistenceCommands()
           
 
Method Summary
static HighScores loadHighScores()
          Loads High Score Table.
static PCharacter loadPC(java.lang.String pcName)
          Restore serialized PCharacter.
static void saveHighScores(HighScores hs)
          Persist high scores (filename is in Config.xml file)
static boolean savePC(PCharacter pc, java.lang.String namepath)
          Serialize Playing Character and his references (Inventory, Skills and such) Extension is taken from Config file.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceCommands

public PersistenceCommands()
Method Detail

savePC

public static boolean savePC(PCharacter pc,
                             java.lang.String namepath)
Serialize Playing Character and his references (Inventory, Skills and such) Extension is taken from Config file.

Parameters:
pc - Playing Character
namepath - complete path where you want to save your character, without extension.
Returns:
true if character has been correctly saved.

loadPC

public static PCharacter loadPC(java.lang.String pcName)
                         throws JurpeException
Restore serialized PCharacter.

Parameters:
pcName - complete path to file with extension.
Returns:
true if character has been correctly restored.
Throws:
JurpeException

saveHighScores

public static void saveHighScores(HighScores hs)
Persist high scores (filename is in Config.xml file)

Parameters:
hs - High Score Table
See Also:
HighScores

loadHighScores

public static HighScores loadHighScores()
Loads High Score Table. If it's not present, it loads a default one.

Returns:
Valid High Score handle

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net