public class SkillSet
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private GuiStateListener |
guiStateListener
The
GuiStateListener for detecting established or dropped
connections. |
private java.util.Map<java.lang.String,Skill> |
namedSkills
Maps skill name to skill instance.
|
private Skill[] |
numberedSkills
Maps stat number to skill instance.
|
Constructor and Description |
---|
SkillSet(GuiStateManager guiStateManager)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addSkill(int id,
java.lang.String skillName,
int face)
Adds a new skill to the list of known skills.
|
void |
clearNumberedSkills()
Clears all stat info in
numberedSkills . |
void |
clearSkills()
Clears all skills.
|
Skill |
getNamedSkill(java.lang.String skillName,
int face)
Returns the skill instance for a given skill name.
|
Skill |
getSkill(int id)
Returns the given skill as a Skill object.
|
int |
getSkillId(java.lang.String name)
Get a skill identifier from the skill name.
|
@NotNull private final GuiStateListener guiStateListener
GuiStateListener
for detecting established or dropped
connections.@NotNull private final java.util.Map<java.lang.String,Skill> namedSkills
@NotNull private final Skill[] numberedSkills
null
if the
server did not provide a mapping.public SkillSet(@NotNull GuiStateManager guiStateManager)
guiStateManager
- the gui state manager to watchpublic void addSkill(int id, @NotNull java.lang.String skillName, int face)
id
- the numerical identifier for the new skillskillName
- the skill nameface
- the skill's facepublic void clearNumberedSkills()
numberedSkills
.public void clearSkills()
@NotNull public Skill getNamedSkill(@NotNull java.lang.String skillName, int face)
skillName
- the skill name to look upface
- the skill face to set.@Nullable public Skill getSkill(int id)
id
- the numerical skill identifiernull
for undefined skillspublic int getSkillId(java.lang.String name)
getSkill(int)
.name
- skill's name