com.huguesjohnson.tiamat
Class Attribute

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

public class Attribute
extends NamedObject

Attribute - used to store character attributes

Author:
Hugues Johnson

Constructor Summary
Attribute(java.lang.String name, java.lang.String description, long baseValue)
          Create a new instance of Attribute.
Attribute(java.lang.String name, java.lang.String description, long baseValue, long currentValue)
          Create a new instance of Attribute.
 
Method Summary
 long getBaseValue()
          Returns the base (initial) value for this attribute.
 long getCurrentValue()
          Returns the current value for this attribute.
 void setBaseValue(long baseValue)
          Sets the base (initial) value for this attribute.
 void setCurrentValue(long currentValue)
          Sets the current value for this attribute.
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class com.huguesjohnson.tiamat.NamedObject
getDescription, getName, onDeserialize, setDescription, setName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute

public Attribute(java.lang.String name,
                 java.lang.String description,
                 long baseValue)
Create a new instance of Attribute.

Parameters:
name - The name of this Attribute.
description - The description of this Attribute.
baseValue - The base (initial) value for this attribute, also sets the current value to this base value.

Attribute

public Attribute(java.lang.String name,
                 java.lang.String description,
                 long baseValue,
                 long currentValue)
Create a new instance of Attribute.

Parameters:
name - The name of this Attribute.
description - The description of this Attribute.
baseValue - The base (initial) value for this attribute.
currentValue - The current value for this attribute.
Method Detail

getBaseValue

public long getBaseValue()
Returns the base (initial) value for this attribute.

Returns:
The base (initial) value for this attribute.

setBaseValue

public void setBaseValue(long baseValue)
Sets the base (initial) value for this attribute.

Parameters:
baseValue - The new base value.

getCurrentValue

public long getCurrentValue()
Returns the current value for this attribute.

Returns:
The current value for this attribute.

setCurrentValue

public void setCurrentValue(long currentValue)
Sets the current value for this attribute.

Parameters:
currentValue - The new current value.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class NamedObject
Returns:
A string representation of the object.