Record Class BattleTimeRemaining

java.lang.Object
java.lang.Record
com.pixelmonmod.pixelmon.api.battles.BattleTimeRemaining
Record Components:
remainingTicks - The number of battle ticks remaining.
totalTicks - The original timed battle duration in battle ticks.
ticksPerSecond - The battle tick rate used for this timer.

public record BattleTimeRemaining(int remainingTicks, int totalTicks, int ticksPerSecond) extends Record
Remaining timed battle state synced to clients.
  • Field Details

  • Constructor Details

    • BattleTimeRemaining

      public BattleTimeRemaining(int remainingTicks, int totalTicks, int ticksPerSecond)
      Creates an instance of a BattleTimeRemaining record class.
      Parameters:
      remainingTicks - the value for the remainingTicks record component
      totalTicks - the value for the totalTicks record component
      ticksPerSecond - the value for the ticksPerSecond record component
  • Method Details

    • remainingSeconds

      public int remainingSeconds()
    • progress

      public float progress()
    • 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 '=='.
      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.
    • remainingTicks

      public int remainingTicks()
      Returns the value of the remainingTicks record component.
      Returns:
      the value of the remainingTicks record component
    • totalTicks

      public int totalTicks()
      Returns the value of the totalTicks record component.
      Returns:
      the value of the totalTicks record component
    • ticksPerSecond

      public int ticksPerSecond()
      Returns the value of the ticksPerSecond record component.
      Returns:
      the value of the ticksPerSecond record component