Class SkillSet


  • public class SkillSet
    extends java.lang.Object
    Maintain the set of skills as sent by the server.
    • Constructor Summary

      Constructors 
      Constructor Description
      SkillSet​(@NotNull GuiStateManager guiStateManager)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSkill​(int id, @NotNull 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.
      @NotNull Skill getNamedSkill​(@NotNull java.lang.String skillName, int face)
      Returns the skill instance for a given skill name.
      @Nullable 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SkillSet

        public SkillSet​(@NotNull
                        @NotNull GuiStateManager guiStateManager)
        Creates a new instance.
        Parameters:
        guiStateManager - the gui state manager to watch
    • Method Detail

      • clearSkills

        public void clearSkills()
        Clears all skills.
      • addSkill

        public void addSkill​(int id,
                             @NotNull
                             @NotNull java.lang.String skillName,
                             int face)
        Adds a new skill to the list of known skills.
        Parameters:
        id - the numerical identifier for the new skill
        skillName - the skill name
        face - the skill's face
      • getNamedSkill

        @NotNull
        public @NotNull Skill getNamedSkill​(@NotNull
                                            @NotNull java.lang.String skillName,
                                            int face)
        Returns the skill instance for a given skill name.
        Parameters:
        skillName - the skill name to look up
        face - the skill face to set.
        Returns:
        the skill instance
      • clearNumberedSkills

        public void clearNumberedSkills()
        Clears all stat info in numberedSkills.
      • getSkill

        @Nullable
        public @Nullable Skill getSkill​(int id)
        Returns the given skill as a Skill object.
        Parameters:
        id - the numerical skill identifier
        Returns:
        the skill object matching the given identifier; may be null for undefined skills
      • getSkillId

        public int getSkillId​(java.lang.String name)
        Get a skill identifier from the skill name. This identifier can be used through getSkill(int).
        Parameters:
        name - skill's name
        Returns:
        skill's identifier, -1 if invalid skill