|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.huguesjohnson.tiamat.SkillCollection
public class SkillCollection
SkillCollection - used to store a collection of skills
Constructor Summary | |
---|---|
SkillCollection()
Default constructor, uses default pathDelimiter. |
|
SkillCollection(Skill[] skills)
Create a new SkillCollection based off an array of Skills with a the default path delimiter. |
|
SkillCollection(Skill[] skills,
java.lang.String pathDelimiter)
Create a new SkillCollection based off an array of Skills with a the default path delimiter. |
|
SkillCollection(java.lang.String pathDelimiter)
Create a new SkillCollection with a custom path delimiter. |
Method Summary | |
---|---|
void |
adjustAllSkills(int percentage)
Adjusts the values of all Skills in the collection by the given percentage, useful for updating all Skills uniformly for gaining/losing a level. |
void |
adjustSkills(java.lang.String rootPath,
int percentage)
Adjusts the values of all Skills under the rootPath by the given percentage, useful for updating all Skills uniformly for gaining/losing a level. |
Skill[] |
getAll()
Returns all Skills in the collection. |
int |
getCount()
Returns the total number of Skills in the collection. |
int |
getCount(java.lang.String path)
Returns the total number of Skills starting from the specified path. |
SkillCollection |
getModifiersFor(java.lang.String targetPath)
Returns a collection of all Skills that have a target with a name equal to targetPath. |
int |
getNetModification(java.lang.String targetPath)
This method is used to get all the modifiers for a target and return the sum of their values. |
Skill |
getSkill(java.lang.String path)
Returns the Skill with the specified path if it exists, otherwise null. |
boolean |
removeSkill(java.lang.String path)
Removes the Skill with the specified path. |
void |
setSkill(java.lang.String path,
Skill skill)
Sets the Skill with the specified path, adds it if it doesn't exist. |
java.lang.String |
toString()
Returns a string representation of the object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public SkillCollection()
public SkillCollection(java.lang.String pathDelimiter)
pathDelimiter
- The new path delimiter to use.public SkillCollection(Skill[] skills)
skills
- The initial set of Skills to add to the collection.public SkillCollection(Skill[] skills, java.lang.String pathDelimiter)
skills
- The initial set of Skills to add to the collection.pathDelimiter
- The new path delimiter to use.Method Detail |
---|
public boolean removeSkill(java.lang.String path)
path
- The path of the Skill to remove.
public Skill getSkill(java.lang.String path)
path
- The path of the Skill to retreive.
public void setSkill(java.lang.String path, Skill skill)
path
- The path of the Skill to set.skill
- The Skill to set.public int getCount()
public int getCount(java.lang.String path)
path
- The starting path to count from.
public SkillCollection getModifiersFor(java.lang.String targetPath)
targetPath
- The target name to look for.
public int getNetModification(java.lang.String targetPath)
targetPath
- The target name to look for.
public void adjustAllSkills(int percentage)
percentage
- The percentage to adjust all Skills by.public void adjustSkills(java.lang.String rootPath, int percentage)
rootPath
- The path name to start at.percentage
- The percentage to adjust all Skills by.public Skill[] getAll()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |