com.huguesjohnson.hapsby
Class SaveGameDefinition

java.lang.Object
  extended by com.huguesjohnson.hapsby.SaveGameDefinition
All Implemented Interfaces:
java.io.Serializable

public class SaveGameDefinition
extends java.lang.Object
implements java.io.Serializable

Class to define the attributes and editable fields of a save game.

Author:
Hugues Johnson
See Also:
Serialized Form

Constructor Summary
SaveGameDefinition()
          Constructor, no logic implemented.
 
Method Summary
 java.lang.String getGameDescription()
          Returns the description of the game.
 java.lang.String getGameTitle()
          Returns the game title.
 java.util.ArrayList<SaveGameProperty> getProperties()
          Returns all properties in this save game definition.
 java.lang.String getSaveFilePattern()
          Returns the name, or pattern of the save game.
 SaveGameProperty getSaveGameProperty(int index)
          Accesses a specific save game property.
 void setGameDescription(java.lang.String gameDescription)
          Sets the game description.
 void setGameTitle(java.lang.String gameTitle)
          Sets the game title.
 void setProperties(java.util.ArrayList<SaveGameProperty> properties)
          Sets the property list.
 void setSaveFilePattern(java.lang.String saveFilePattern)
          Sets the save file pattern.
 java.lang.String toString()
          Returns the game title.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SaveGameDefinition

public SaveGameDefinition()
Constructor, no logic implemented.

Method Detail

getGameTitle

public final java.lang.String getGameTitle()
Returns the game title.

Returns:
The game title.

getGameDescription

public final java.lang.String getGameDescription()
Returns the description of the game.

Returns:
The description of the game.

getSaveFilePattern

public final java.lang.String getSaveFilePattern()
Returns the name, or pattern of the save game.

Returns:
The file name (ie. save.dat) or pattern (ie. *.dat) of the game.

getProperties

public java.util.ArrayList<SaveGameProperty> getProperties()
Returns all properties in this save game definition.

Returns:
All properties in this save game definition.

getSaveGameProperty

public SaveGameProperty getSaveGameProperty(int index)
Accesses a specific save game property.

Parameters:
index - Index of the element to retrieve.
Returns:
The SaveGameProperty at the specified index.

setProperties

public void setProperties(java.util.ArrayList<SaveGameProperty> properties)
Sets the property list.

Parameters:
properties - The new properties for the save game.

setGameTitle

public void setGameTitle(java.lang.String gameTitle)
Sets the game title.

Parameters:
gameTitle - The new title for the save game.

setGameDescription

public void setGameDescription(java.lang.String gameDescription)
Sets the game description.

Parameters:
gameDescription - The new game description.

setSaveFilePattern

public void setSaveFilePattern(java.lang.String saveFilePattern)
Sets the save file pattern.

Parameters:
saveFilePattern - The new file name (ie. save.dat) or pattern (ie. *.dat) of the game.

toString

public java.lang.String toString()
Returns the game title. toString() is implicitly called by JList and JTable components when complex objects are added. This needs to return the text that should be displayed in these controls. In this case, it's the game title.

Overrides:
toString in class java.lang.Object
Returns:
The game title.


Copyright © 2000-2009 Hugues Johnson