org.haphazard.character
Class GlobalSkill

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

public class GlobalSkill
extends java.lang.Object

A system wide list of all available skills and their descriptions


Method Summary
 void add(GeneralSkill skill)
          Adds a skill to the global skill list
 GeneralSkill get(java.lang.String skill)
          Gets a skill
static GlobalSkill getInstance()
          Gets the instance of GlobalSkill
 java.util.Vector getList()
          Gets the whole slew of skills in a nice list Only the name is listed
 void load(java.io.InputStream stream)
          Loads a global skill list from a file Clears the global skill list before load.
 void remove(java.lang.String skill)
          removes a skill from the global skill list
 int roll(int value, int penalty)
          Rolls a statistic
 void save(java.io.OutputStream stream)
          Saves the global skill list in an XML-file
 java.lang.String toXML(int indent)
          Translates this object into an XML notation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static GlobalSkill getInstance()
Gets the instance of GlobalSkill

Returns:
The only instance of GlobalSkill

add

public void add(GeneralSkill skill)
Adds a skill to the global skill list

Parameters:
skill - The skill to add

remove

public void remove(java.lang.String skill)
removes a skill from the global skill list

Parameters:
skill - The skill to remove

get

public GeneralSkill get(java.lang.String skill)
Gets a skill

Parameters:
skill - The name of the skill to get
Returns:
The skill if found, null if otherwise

getList

public java.util.Vector getList()
Gets the whole slew of skills in a nice list Only the name is listed

Returns:
The name of every skill that exists in the list

roll

public int roll(int value,
                int penalty)
Rolls a statistic

Parameters:
value - The value of the skill to roll
penalty - Any eventual penalties to the roll
Returns:
The resulting roll with penalties applied

save

public void save(java.io.OutputStream stream)
Saves the global skill list in an XML-file

Parameters:
stream - The stream to save to

load

public void load(java.io.InputStream stream)
Loads a global skill list from a file Clears the global skill list before load.

Parameters:
stream - The stream to load from

toXML

public java.lang.String toXML(int indent)
Translates this object into an XML notation

Parameters:
indent - The level of indentation to use
Returns:
The object in XML notation