org.haphazard.character
Class Skill

java.lang.Object
  extended byorg.haphazard.character.Skill

public class Skill
extends java.lang.Object

Denotes a skill that can be used by an character This class contains all specific information related to a skill. For more knowledge about the skill, please see GeneralSkill


Field Summary
 int mValue
           
 
Constructor Summary
Skill(java.lang.String name)
          Creates a new skill
Skill(java.lang.String name, int value)
          Creates a new skill with a name and a value
Skill(java.lang.String name, int value, int experience)
          Creates a new skill with a name and a value
 
Method Summary
 void addExperience(int points)
          Adds experience points to the skill
 double experienceProgress()
          Gets the current progress towards the next level
 int getBaseValue()
          Gets the base value of this skill
 java.lang.String getDescription()
          Gets the desription of the skill
 java.lang.String getName()
          Gets the name of the skill
 java.lang.String getParent()
          Gets the parent of the skill
 void processDay()
          Call when to prcess a day for updating and forgetting skills
 void setBaseValue(int base)
          Sets the skills base value Only applicable to skills without a parent (interface stats)
 void setParent(Skill parent)
          Sets the parent of this skill
 java.lang.String toString()
          Translates this object into a String representation
 java.lang.String toXML(int indent)
          Transforms this skill into an XML-notation
 void update(Skill skill)
          Updates this skill with another skills stats
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mValue

public int mValue
Constructor Detail

Skill

public Skill(java.lang.String name)
Creates a new skill

Parameters:
name - The Skill to create

Skill

public Skill(java.lang.String name,
             int value)
Creates a new skill with a name and a value

Parameters:
name - The name of the skill
value - The value of the skill

Skill

public Skill(java.lang.String name,
             int value,
             int experience)
Creates a new skill with a name and a value

Parameters:
name - The name of the skill
value - The value of the skill
experience - The current level of experience for the skill
Method Detail

getName

public java.lang.String getName()
Gets the name of the skill

Returns:
The name of the skill

setBaseValue

public void setBaseValue(int base)
Sets the skills base value Only applicable to skills without a parent (interface stats)

Parameters:
base - The base value to set

getBaseValue

public int getBaseValue()
Gets the base value of this skill

Returns:
The base value that can't be moved under by forgetting

addExperience

public void addExperience(int points)
Adds experience points to the skill


experienceProgress

public double experienceProgress()
Gets the current progress towards the next level

Returns:
-1.0 to +1.0

processDay

public void processDay()
Call when to prcess a day for updating and forgetting skills


update

public void update(Skill skill)
Updates this skill with another skills stats

Parameters:
skill - The skill to update to

getDescription

public java.lang.String getDescription()
Gets the desription of the skill

Returns:
The description

getParent

public java.lang.String getParent()
Gets the parent of the skill

Returns:
The parent skill of this skill

setParent

public void setParent(Skill parent)
Sets the parent of this skill

Parameters:
parent - The parent of this skill

toXML

public java.lang.String toXML(int indent)
Transforms this skill into an XML-notation

Parameters:
indent - The indentation level to use
Returns:
The skill in an XML notation

toString

public java.lang.String toString()
Translates this object into a String representation

Returns:
A string representation of the object (name)