java.lang.Objectcom.realtime.crossfire.jxclient.skills.SkillSet
public class SkillSet
Maintain the set of skills as sent by the server.
| Field Summary | |
|---|---|
private CrossfireSkillInfoListener |
crossfireSkillInfoListener
The CrossfireSkillInfoListener attached to the server connection
for detecting changed skill info. |
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 Summary | |
|---|---|
SkillSet(CrossfireServerConnection crossfireServerConnection,
GuiStateManager guiStateManager)
Creates a new instance. |
|
| Method Summary | |
|---|---|
private void |
addSkill(int id,
java.lang.String skillName)
Adds a new skill to the list of known skills. |
void |
clearNumberedSkills()
Clears all stat info in numberedSkills. |
Skill |
getNamedSkill(java.lang.String skillName)
Return the skill instance for a given skill name. |
Skill |
getSkill(int id)
Returns the given skill as a Skill object. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
@NotNull private final CrossfireSkillInfoListener crossfireSkillInfoListener
CrossfireSkillInfoListener attached to the server connection
for detecting changed skill info.
@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.
| Constructor Detail |
|---|
public SkillSet(@NotNull
CrossfireServerConnection crossfireServerConnection,
@NotNull
GuiStateManager guiStateManager)
crossfireServerConnection - the server connection to monitorguiStateManager - the gui state manager to watch| Method Detail |
|---|
private void addSkill(int id,
@NotNull
java.lang.String skillName)
id - The numerical identifier for the new skill.skillName - The skill name.public void clearNumberedSkills()
numberedSkills.
public Skill getNamedSkill(java.lang.String skillName)
skillName - The skill name to look up.
@Nullable public Skill getSkill(int id)
id - The numerical skill identifier.
null for undefined skills.