Class Skill


  • public class Skill
    extends java.lang.Object
    One skill of the character.
    • Constructor Summary

      Constructors 
      Constructor Description
      Skill​(@NotNull java.lang.String name)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSkillListener​(@NotNull SkillListener listener)
      Adds a listener to be notified of changes.
      long getExperience()
      Returns the skill experience.
      int getFace()
      Returns the skill's face.
      int getLevel()
      Returns the skill level.
      void removeSkillListener​(@NotNull SkillListener listener)
      Removes a listener to be notified of changes.
      void set​(int level, long experience)
      Updates the skill attributes.
      void setFace​(int face)
      Defines the skill's face.
      @NotNull java.lang.String toString()  
      • Methods inherited from class java.lang.Object

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

      • Skill

        public Skill​(@NotNull
                     @NotNull java.lang.String name)
        Creates a new instance.
        Parameters:
        name - the skill name
    • Method Detail

      • set

        public void set​(int level,
                        long experience)
        Updates the skill attributes.
        Parameters:
        level - the new skill level
        experience - the new skill experience
      • getExperience

        public long getExperience()
        Returns the skill experience.
        Returns:
        the skill experience
      • getLevel

        public int getLevel()
        Returns the skill level.
        Returns:
        the skill level
      • getFace

        public int getFace()
        Returns the skill's face.
        Returns:
        face number, -1 if no face defined.
      • setFace

        public void setFace​(int face)
        Defines the skill's face.
        Parameters:
        face - new face index.
      • toString

        @NotNull
        public @NotNull java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • addSkillListener

        public void addSkillListener​(@NotNull
                                     @NotNull SkillListener listener)
        Adds a listener to be notified of changes.
        Parameters:
        listener - the listener to add
      • removeSkillListener

        public void removeSkillListener​(@NotNull
                                        @NotNull SkillListener listener)
        Removes a listener to be notified of changes.
        Parameters:
        listener - the listener to remove