Enum Class PokemonAndHealth
- All Implemented Interfaces:
Serializable,Comparable<PokemonAndHealth>,Constable
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();
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBlastoise's default health value.Bulbasaur's default health value.Charizard's default health value.Charmander's default health value.Charmeleon's default health value.Ivysaur's default health value.Pikachu's default health value.Raichu's default health value.Squirtle's default health value.Venusaur's default health value.Wartortle's default health value. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intThe default health associated with the Pokémon. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePokemonAndHealth(int health) Constructs aPokemonAndHealthenum constant with the specified default health value. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the default health value for this Pokémon.static PokemonAndHealthReturns the enum constant of this class with the specified name.static PokemonAndHealth[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
PIKACHU
Pikachu's default health value. -
RAICHU
Raichu's default health value. -
CHARIZARD
Charizard's default health value. -
CHARMANDER
Charmander's default health value. -
CHARMELEON
Charmeleon's default health value. -
BULBASAUR
Bulbasaur's default health value. -
IVYSAUR
Ivysaur's default health value. -
VENUSAUR
Venusaur's default health value. -
BLASTOISE
Blastoise's default health value. -
SQUIRTLE
Squirtle's default health value. -
WARTORTLE
Wartortle's default health value.
-
-
Field Details
-
health
private final int healthThe default health associated with the Pokémon.
-
-
Constructor Details
-
PokemonAndHealth
private PokemonAndHealth(int health) Constructs aPokemonAndHealthenum constant with the specified default health value.- Parameters:
health- the starting health of the Pokémon
-
-
Method Details
-
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
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 nameNullPointerException- 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
-