org.mars_sim.msp.simulation.person.ai
Class SkillManager

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.ai.SkillManager
All Implemented Interfaces:
java.io.Serializable

public class SkillManager
extends java.lang.Object
implements java.io.Serializable

The SkillManager class manages skills for a given person. Each person has one skill manager.

See Also:
Serialized Form

Method Summary
 void addExperience(java.lang.String skillName, double experiencePoints)
          Adds given experience points to a named skill if it exists in the SkillManager.
 void addNewSkill(Skill newSkill)
          Adds a new skill to the SkillManager and indexes it under its name.
 int getEffectiveSkillLevel(java.lang.String skillName)
          Returns the effective integer skill level from a named skill based on additional modifiers such as fatigue.
 java.lang.String[] getKeys()
          Returns an array of the skill names as strings.
 int getSkillLevel(java.lang.String skillName)
          Returns the integer skill level from a named skill if it exists in the SkillManager.
 int getSkillNum()
          Returns the number of skills.
 boolean hasSkill(java.lang.String skillName)
          Returns true if the SkillManager has the named skill, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSkillNum

public int getSkillNum()
Returns the number of skills.

Returns:
the number of skills

getKeys

public java.lang.String[] getKeys()
Returns an array of the skill names as strings.

Returns:
an array of the skill names

hasSkill

public boolean hasSkill(java.lang.String skillName)
Returns true if the SkillManager has the named skill, false otherwise.

Parameters:
skillName - the skill's name
Returns:
true if the manager has the named skill

getSkillLevel

public int getSkillLevel(java.lang.String skillName)
Returns the integer skill level from a named skill if it exists in the SkillManager. Returns 0 otherwise.

Parameters:
skillName - the skill's name
Returns:
the skill's level

getEffectiveSkillLevel

public int getEffectiveSkillLevel(java.lang.String skillName)
Returns the effective integer skill level from a named skill based on additional modifiers such as fatigue.

Parameters:
skillName - the skill's name
Returns:
the skill's effective level

addNewSkill

public void addNewSkill(Skill newSkill)
Adds a new skill to the SkillManager and indexes it under its name.

Parameters:
newSkill - the skill to be added

addExperience

public void addExperience(java.lang.String skillName,
                          double experiencePoints)
Adds given experience points to a named skill if it exists in the SkillManager. If it doesn't exist, create a skill of that name in the SkillManager and add the experience points to it.

Parameters:
skillName - the skill's name
experiencePoints - the experience points to be added