Record Class BattleAnimationClientAcknowledgement

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.animation.schedule.BattleAnimationClientAcknowledgement

public record BattleAnimationClientAcknowledgement(int timeoutTicks, BattleAnimationAcknowledgeTimeoutPolicy timeoutPolicy, Optional<ScheduledBattleAnimationAction> timeoutFallback) extends Record
Configuration for waiting on client acknowledgement before a timeline proceeds.
  • Field Details

  • Constructor Details

    • BattleAnimationClientAcknowledgement

      public BattleAnimationClientAcknowledgement(int timeoutTicks, BattleAnimationAcknowledgeTimeoutPolicy timeoutPolicy, Optional<ScheduledBattleAnimationAction> timeoutFallback)
      Creates an instance of a BattleAnimationClientAcknowledgement record class.
      Parameters:
      timeoutTicks - the value for the timeoutTicks record component
      timeoutPolicy - the value for the timeoutPolicy record component
      timeoutFallback - the value for the timeoutFallback record component
  • Method Details

    • isNone

      public boolean isNone()
      Returns whether this configuration disables acknowledgement waiting.
      Returns:
      true when no acknowledgement should be requested
    • createState

      public ClientAcknowledgementState createState(Set<UUID> waitingFor)
      Creates the runtime acknowledgement state for a set of clients.
      Parameters:
      waitingFor - the player ids that must acknowledge
      Returns:
      the acknowledgement state
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      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.
    • timeoutTicks

      public int timeoutTicks()
      Returns the value of the timeoutTicks record component.
      Returns:
      the value of the timeoutTicks record component
    • timeoutPolicy

      Returns the value of the timeoutPolicy record component.
      Returns:
      the value of the timeoutPolicy record component
    • timeoutFallback

      public Optional<ScheduledBattleAnimationAction> timeoutFallback()
      Returns the value of the timeoutFallback record component.
      Returns:
      the value of the timeoutFallback record component