com.huguesjohnson.tiamat
Class Location

java.lang.Object
  extended by com.huguesjohnson.tiamat.Location
All Implemented Interfaces:
Storable

public class Location
extends java.lang.Object
implements Storable

Location- represents a place a player can visit

Author:
Hugues Johnson

Field Summary
protected  java.lang.String absoluteDir
           
 
Constructor Summary
Location()
          Creates a new instance of Location.
 
Method Summary
 void addCharacter(LocationObjectData locationData)
          Adds the Character defined by the LocationObjectData.
 void addCharacter(java.lang.String name)
          Adds a Character with default settings.
 void addItem(LocationObjectData locationData)
          Adds the Item defined by the LocationObjectData.
 void addItem(java.lang.String name)
          Adds an Item with default settings.
 java.lang.String getBgImagePath()
          Returns the relative path to the background image.
 java.lang.String getBgImagePathAbsolute()
          Returns the absolute path to the background image.
 java.lang.String getBgMusicPath()
          Returns the relative path to the background music.
 java.lang.String getBgMusicPathAbsolute()
          Returns the absolute path to the background music.
 LocationObjectData[] getCharacters()
          Returns a LocationObjectData array containing information about the Characters in the Location.
 LocationExit[] getExits()
          Retuns all the exits from this Location.
 LocationObjectData[] getItems()
          Returns a LocationObjectData array containing information about the Items in the Location.
 java.lang.String getOverlayImagePath()
          Returns the relative path to the overlay image.
 java.lang.String getOverlayImagePathAbsolute()
          Returns the absolute path to the overlay image.
 void onDeserialize(Formatter formatter, java.lang.String absoluteDir)
          The onDeserialize event should be fired after an object is de-serialized.
 void removeCharacter(java.lang.String name)
          Removes the Character with the specified name.
 void removeItem(java.lang.String name)
          Removes the Item with the specified name.
 void setAbsoluteDir(java.lang.String absoluteDir)
          Sets the absolute working directory for files.
 void setBgImagePath(java.lang.String bgImagePath)
          Sets the relative path to the background image.
 void setBgMusicPath(java.lang.String bgMusicPath)
          Sets the relative path to the background music.
 void setCharacters(LocationObjectData[] characters)
          Sets the information about the Characters in the Location.
 void setExits(LocationExit[] exits)
          Sets all the exits from this Location.
 void setItems(LocationObjectData[] items)
          Sets the information about the Items in the Location.
 void setOverlayImagePath(java.lang.String overlayImagePath)
          Sets the relative path to the overlay image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

absoluteDir

protected transient java.lang.String absoluteDir
Constructor Detail

Location

public Location()
Creates a new instance of Location.

Method Detail

getExits

public LocationExit[] getExits()
Retuns all the exits from this Location.

Returns:
All the exits from this Location.

setExits

public void setExits(LocationExit[] exits)
Sets all the exits from this Location.

Parameters:
exits - All the exits from this Location.

getBgMusicPath

public java.lang.String getBgMusicPath()
Returns the relative path to the background music.

Returns:
The relative path to the background music.

setBgMusicPath

public void setBgMusicPath(java.lang.String bgMusicPath)
Sets the relative path to the background music.

Parameters:
bgMusicPath - The relative path to the background music.

getBgMusicPathAbsolute

public java.lang.String getBgMusicPathAbsolute()
Returns the absolute path to the background music.

Returns:
The absolute path to the background music.

setBgImagePath

public void setBgImagePath(java.lang.String bgImagePath)
Sets the relative path to the background image.

Parameters:
bgImagePath - The relative path to the background image.

getBgImagePath

public java.lang.String getBgImagePath()
Returns the relative path to the background image.

Returns:
The relative path to the background image.

getBgImagePathAbsolute

public java.lang.String getBgImagePathAbsolute()
Returns the absolute path to the background image.

Returns:
The absolute path to the background image.

setOverlayImagePath

public void setOverlayImagePath(java.lang.String overlayImagePath)
Sets the relative path to the overlay image.

Parameters:
overlayImagePath - The relative path to the overlay image.

getOverlayImagePath

public java.lang.String getOverlayImagePath()
Returns the relative path to the overlay image.

Returns:
The relative path to the overlay image.

getOverlayImagePathAbsolute

public java.lang.String getOverlayImagePathAbsolute()
Returns the absolute path to the overlay image.

Returns:
The absolute path to the overlay image.

getItems

public LocationObjectData[] getItems()
Returns a LocationObjectData array containing information about the Items in the Location.

Returns:
A LocationObjectData array containing information about the Items in the Location.

setItems

public void setItems(LocationObjectData[] items)
Sets the information about the Items in the Location.

Parameters:
items - A LocationObjectData array containing information about the Items in the Location.

getCharacters

public LocationObjectData[] getCharacters()
Returns a LocationObjectData array containing information about the Characters in the Location.

Returns:
A LocationObjectData array containing information about the Characters in the Location.

setCharacters

public void setCharacters(LocationObjectData[] characters)
Sets the information about the Characters in the Location.

Parameters:
characters - A LocationObjectData array containing information about the Characters in the Location.

setAbsoluteDir

public void setAbsoluteDir(java.lang.String absoluteDir)
Sets the absolute working directory for files.

Parameters:
absoluteDir - The full path to the working directory.

addCharacter

public void addCharacter(java.lang.String name)
Adds a Character with default settings.

Parameters:
name - The name of the Character to add.

addCharacter

public void addCharacter(LocationObjectData locationData)
Adds the Character defined by the LocationObjectData.

Parameters:
locationData - The information about the Character.

removeCharacter

public void removeCharacter(java.lang.String name)
Removes the Character with the specified name.

Parameters:
name - The name of the Character to remove.

addItem

public void addItem(java.lang.String name)
Adds an Item with default settings.

Parameters:
name - The name of the Item to add.

addItem

public void addItem(LocationObjectData locationData)
Adds the Item defined by the LocationObjectData.

Parameters:
locationData - The information about the Item.

removeItem

public void removeItem(java.lang.String name)
Removes the Item with the specified name.

Parameters:
name - The name of the Item to remove.

onDeserialize

public void onDeserialize(Formatter formatter,
                          java.lang.String absoluteDir)
Description copied from interface: Storable
The onDeserialize event should be fired after an object is de-serialized. This allows objects to load transient members, set their working directory, and load Storable members if needed.

Specified by:
onDeserialize in interface Storable
Parameters:
formatter - the formatter to use to load any storable members
absoluteDir - the working directory since all paths stored in the object should be relative


Copyright © 2004-2006 Hugues Johnson