com.huguesjohnson.tiamat
Class Character

java.lang.Object
  extended by com.huguesjohnson.tiamat.Character
All Implemented Interfaces:
Storable
Direct Known Subclasses:
NonPlayerCharacter, PlayerCharacter

public abstract class Character
extends java.lang.Object
implements Storable

Character - abstract representation of a character

Author:
Hugues Johnson

Constructor Summary
Character()
          creates an empty Character
 
Method Summary
 AttributeCollection getAttributes()
           
 java.awt.image.BufferedImage getFullImage()
          Returns the full-size image for this item, change by setting fullImagePath.
 java.lang.String getFullImagePath()
          Retuns the relative path to full-size image for this Character.
 java.lang.String getFullImagePathAbsolute()
          Retuns the absolute path to full-size image for this Character.
 ItemCollection getItems()
          Returns the Items this Character is carrying.
 StringTable getProfile()
          Returns the profile (i.e.
 SkillCollection getSkills()
          Returns this Character's Skills.
 Sprite getSprite()
          Returns the physical sprite for this Character, change by setting spritePath.
 java.lang.String getSpritePath()
          Returns the relative path to this Character's Sprite.
 java.lang.String getSpritePathAbsolute()
          Returns the absolute path to this Character's Sprite.
 java.awt.image.BufferedImage getThumbnailImage()
          Returns the thumbnail image for this item, what would appear in a menu or dialog, change by setting thumbnailImagePath.
 java.lang.String getThumbnailImagePath()
          Retuns the relative path to thumbnail image for this Character.
 java.lang.String getThumbnailImagePathAbsolute()
          Retuns the absolute path to thumbnail image for this Character.
 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 working directory for files.
 void setAttributes(AttributeCollection attributes)
           
 void setFullImagePath(java.lang.String fullImagePath)
          Sets the relative path to full-size image for this Character, setting this reloads the actual image.
 void setItems(ItemCollection items)
          Sets the Items this Character is carrying.
 void setProfile(StringTable profile)
          Sets the profile (i.e.
 void setSkills(SkillCollection skills)
          Sets this Character's Skills.
 void setSpritePath(java.lang.String spritePath, Formatter formatter)
          Sets the path to the Sprite's underlying file, setting this reloads the Sprite.
 void setThumbnailImagePath(java.lang.String thumbnailImagePath)
          Sets the relative path to thumbnail image for this Character, what would appear in a menu or dialog, setting this reloads the actual image.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Character

public Character()
creates an empty Character

Method Detail

setFullImagePath

public void setFullImagePath(java.lang.String fullImagePath)
Sets the relative path to full-size image for this Character, setting this reloads the actual image.

Parameters:
fullImagePath - The relative path to full-size image for this Character.

getFullImagePath

public java.lang.String getFullImagePath()
Retuns the relative path to full-size image for this Character.

Returns:
The relative path to full-size image for this Character.

getFullImagePathAbsolute

public java.lang.String getFullImagePathAbsolute()
Retuns the absolute path to full-size image for this Character.

Returns:
The absolute path to full-size image for this Character.

getFullImage

public java.awt.image.BufferedImage getFullImage()
Returns the full-size image for this item, change by setting fullImagePath.

Returns:
The full-size image for this item, change by setting fullImagePath.

getThumbnailImage

public java.awt.image.BufferedImage getThumbnailImage()
Returns the thumbnail image for this item, what would appear in a menu or dialog, change by setting thumbnailImagePath.

Returns:
The thumbnail image for this item, what would appear in a menu or dialog, change by setting thumbnailImagePath.

setThumbnailImagePath

public void setThumbnailImagePath(java.lang.String thumbnailImagePath)
Sets the relative path to thumbnail image for this Character, what would appear in a menu or dialog, setting this reloads the actual image.

Parameters:
thumbnailImagePath - The relative path to thumbnail image for this Character, what would appear in a menu or dialog, setting this reloads the actual image.

getThumbnailImagePath

public java.lang.String getThumbnailImagePath()
Retuns the relative path to thumbnail image for this Character.

Returns:
The relative path to thumbnail image for this Character.

getThumbnailImagePathAbsolute

public java.lang.String getThumbnailImagePathAbsolute()
Retuns the absolute path to thumbnail image for this Character.

Returns:
The absolute path to thumbnail image for this Character.

getAttributes

public AttributeCollection getAttributes()

setAttributes

public void setAttributes(AttributeCollection attributes)

getItems

public ItemCollection getItems()
Returns the Items this Character is carrying.

Returns:
The Items this Character is carrying.

setItems

public void setItems(ItemCollection items)
Sets the Items this Character is carrying.

Parameters:
items - The new Items for this Character.

getSkills

public SkillCollection getSkills()
Returns this Character's Skills.

Returns:
This Character's Skills.

setSkills

public void setSkills(SkillCollection skills)
Sets this Character's Skills.

Parameters:
skills - The new Skills for this Character.

getProfile

public StringTable getProfile()
Returns the profile (i.e. name, class, or race) for this Character.

Returns:
The profile (i.e. name, class, or race) for this Character.

setProfile

public void setProfile(StringTable profile)
Sets the profile (i.e. name, class, or race) for this Character.

Parameters:
profile - The new profile (i.e. name, class, or race) for this Character.

getSpritePath

public java.lang.String getSpritePath()
Returns the relative path to this Character's Sprite.

Returns:
The relative path to this Character's Sprite.

getSpritePathAbsolute

public java.lang.String getSpritePathAbsolute()
Returns the absolute path to this Character's Sprite.

Returns:
The absolute path to this Character's Sprite.

setSpritePath

public void setSpritePath(java.lang.String spritePath,
                          Formatter formatter)
Sets the path to the Sprite's underlying file, setting this reloads the Sprite.

Parameters:
spritePath - The relative path to the Sprite's underlying file, setting this reloads the Sprite.
formatter - The formatter used to deserialize this Sprite.

getSprite

public Sprite getSprite()
Returns the physical sprite for this Character, change by setting spritePath.

Returns:
The physical sprite for this Character.

setAbsoluteDir

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

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

onDeserialize

public void onDeserialize(Formatter formatter,
                          java.lang.String absoluteDir)
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