Record Class PokemonMemory
java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.battles.controller.ai.memory.PokemonMemory
public record PokemonMemory(UUID pokemonUUID, List<Attack> guessedAttacks, List<Attack> knownAttacks)
extends Record
Information that the AI has gathered about an opponent Pokémon.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PokemonMemorycalculate(PixelmonWrapper pokemon) Creates an OpponentMemory for a given Pokémon, making guesses about its moves based on its type(s).final booleanIndicates whether some other object is "equal to" this one.Gets the attacks that the AI thinks this Pokémon has.Returns the value of theguessedAttacksrecord component.final inthashCode()Returns a hash code value for this object.Returns the value of theknownAttacksrecord component.Returns the value of thepokemonUUIDrecord component.seeAttack(PixelmonWrapper user, Attack attack) Registers an attack that the AI has seen.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
CODEC
-
-
Constructor Details
-
PokemonMemory
Creates an instance of aPokemonMemoryrecord class.- Parameters:
pokemonUUID- the value for thepokemonUUIDrecord componentguessedAttacks- the value for theguessedAttacksrecord componentknownAttacks- the value for theknownAttacksrecord component
-
-
Method Details
-
calculate
Creates an OpponentMemory for a given Pokémon, making guesses about its moves based on its type(s).- Parameters:
pokemon- The Pokémon to create memory for.- Returns:
- The created OpponentMemory.
-
seeAttack
Registers an attack that the AI has seen.- Parameters:
user- The user of the attack.attack- The attack that was seen.
-
getAttacks
Gets the attacks that the AI thinks this Pokémon has.- Returns:
- The attacks that the AI thinks this Pokémon has.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
pokemonUUID
Returns the value of thepokemonUUIDrecord component.- Returns:
- the value of the
pokemonUUIDrecord component
-
guessedAttacks
Returns the value of theguessedAttacksrecord component.- Returns:
- the value of the
guessedAttacksrecord component
-
knownAttacks
Returns the value of theknownAttacksrecord component.- Returns:
- the value of the
knownAttacksrecord component
-