Enum Class PokemonAndHealth

java.lang.Object
java.lang.Enum<PokemonAndHealth>
Pokemon.Attributes.PokemonAndHealth
All Implemented Interfaces:
Serializable, Comparable<PokemonAndHealth>, Constable

public enum PokemonAndHealth extends Enum<PokemonAndHealth>
Enumeration defining Pokémon species along with their default health values.

PokemonAndHealth provides a centralized mapping between a Pokémon's species and its starting health. This enum is typically used during Pokémon creation to ensure consistent initialization of health values across the game.

Example usage:


 int pikachuHealth = PokemonAndHealth.PIKACHU.getHealth();
 
  • Enum Constant Details

    • PIKACHU

      public static final PokemonAndHealth PIKACHU
      Pikachu's default health value.
    • RAICHU

      public static final PokemonAndHealth RAICHU
      Raichu's default health value.
    • CHARIZARD

      public static final PokemonAndHealth CHARIZARD
      Charizard's default health value.
    • CHARMANDER

      public static final PokemonAndHealth CHARMANDER
      Charmander's default health value.
    • CHARMELEON

      public static final PokemonAndHealth CHARMELEON
      Charmeleon's default health value.
    • BULBASAUR

      public static final PokemonAndHealth BULBASAUR
      Bulbasaur's default health value.
    • IVYSAUR

      public static final PokemonAndHealth IVYSAUR
      Ivysaur's default health value.
    • VENUSAUR

      public static final PokemonAndHealth VENUSAUR
      Venusaur's default health value.
    • BLASTOISE

      public static final PokemonAndHealth BLASTOISE
      Blastoise's default health value.
    • SQUIRTLE

      public static final PokemonAndHealth SQUIRTLE
      Squirtle's default health value.
    • WARTORTLE

      public static final PokemonAndHealth WARTORTLE
      Wartortle's default health value.
  • Field Details

    • health

      private final int health
      The default health associated with the Pokémon.
  • Constructor Details

    • PokemonAndHealth

      private PokemonAndHealth(int health)
      Constructs a PokemonAndHealth enum constant with the specified default health value.
      Parameters:
      health - the starting health of the Pokémon
  • Method Details

    • values

      public static PokemonAndHealth[] 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 PokemonAndHealth 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
    • getHealth

      public int getHealth()
      Returns the default health value for this Pokémon.
      Returns:
      the Pokémon's starting health