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 Details

    • CODEC

      public static final com.mojang.serialization.Codec<PokemonMemory> CODEC
  • Constructor Details

    • PokemonMemory

      public PokemonMemory(UUID pokemonUUID, List<Attack> guessedAttacks, List<Attack> knownAttacks)
      Creates an instance of a PokemonMemory record class.
      Parameters:
      pokemonUUID - the value for the pokemonUUID record component
      guessedAttacks - the value for the guessedAttacks record component
      knownAttacks - the value for the knownAttacks record component
  • Method Details

    • calculate

      public static PokemonMemory calculate(PixelmonWrapper pokemon)
      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

      public PokemonMemory seeAttack(PixelmonWrapper user, Attack attack)
      Registers an attack that the AI has seen.
      Parameters:
      user - The user of the attack.
      attack - The attack that was seen.
    • getAttacks

      public List<Attack> getAttacks()
      Gets the attacks that the AI thinks this Pokémon has.
      Returns:
      The attacks that the AI thinks this Pokémon has.
    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • pokemonUUID

      public UUID pokemonUUID()
      Returns the value of the pokemonUUID record component.
      Returns:
      the value of the pokemonUUID record component
    • guessedAttacks

      public List<Attack> guessedAttacks()
      Returns the value of the guessedAttacks record component.
      Returns:
      the value of the guessedAttacks record component
    • knownAttacks

      public List<Attack> knownAttacks()
      Returns the value of the knownAttacks record component.
      Returns:
      the value of the knownAttacks record component