Enum Class CharacterType

java.lang.Object
java.lang.Enum<CharacterType>
model.entity.CharacterType
All Implemented Interfaces:
Serializable, Comparable<CharacterType>, Constable

public enum CharacterType extends Enum<CharacterType>
Enum of selectable characters that also acts as a factory for the correct Player subclass. To add a new character, simply add an entry here.
  • Enum Constant Details

    • KNIGHT

      public static final CharacterType KNIGHT
      Swordsman with high HP and good defense. Skill attacks twice.
    • ARCHER

      public static final CharacterType ARCHER
      Archer with the highest ATK. Skill pierces defense.
    • REBORN

      public static final CharacterType REBORN
      Cleric with a 5-slot inventory. Skill restores HP.
    • ALIEN

      public static final CharacterType ALIEN
      Alien with magic attacks that bypass defense; can move diagonally.
  • Constructor Details

    • CharacterType

      private CharacterType()
  • Method Details

    • values

      public static CharacterType[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CharacterType valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • createPlayer

      public abstract Player createPlayer()
      Creates the Player subclass corresponding to this CharacterType.
      Returns:
      A new Player instance