Record Class ScheduledBattleAnimationAction

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

public record ScheduledBattleAnimationAction(String channel, BattleAnimationChannelScope channelScope, BattleAnimationTime start, BattleAnimationTime end, BattleAnimationChannelPolicy policy, boolean blocksBattle, BattleAnimationClientAcknowledgement clientAcknowledgement, BattleAnimationAction action) extends Record
One action entry in a battle animation timeline schedule.
  • Field Details

  • Constructor Details

    • ScheduledBattleAnimationAction

      public ScheduledBattleAnimationAction(String channel, BattleAnimationChannelScope channelScope, BattleAnimationTime start, BattleAnimationTime end, BattleAnimationChannelPolicy policy, boolean blocksBattle, BattleAnimationClientAcknowledgement clientAcknowledgement, BattleAnimationAction action)
      Creates an instance of a ScheduledBattleAnimationAction record class.
      Parameters:
      channel - the value for the channel record component
      channelScope - the value for the channelScope record component
      start - the value for the start record component
      end - the value for the end record component
      policy - the value for the policy record component
      blocksBattle - the value for the blocksBattle record component
      clientAcknowledgement - the value for the clientAcknowledgement record component
      action - the value for the action record component
  • Method Details

    • effectiveChannel

      public String effectiveChannel(BattleController controller)
      Resolves the effective channel for this action and battle controller.
      Parameters:
      controller - the current battle controller
      Returns:
      the scoped channel name
    • resolveStart

      public int resolveStart(Map<String,Integer> markers)
      Resolves this action's start tick.
      Parameters:
      markers - the timeline marker map
      Returns:
      the resolved start tick
    • resolveEnd

      public int resolveEnd(Map<String,Integer> markers)
      Resolves this action's end tick.
      Parameters:
      markers - the timeline marker map
      Returns:
      the resolved end tick, or -1 when no end is defined
    • resolveDuration

      public int resolveDuration(Map<String,Integer> markers)
      Resolves how long the action may run after it actually starts.
      Parameters:
      markers - the timeline marker map
      Returns:
      the resolved duration, or -1 when no explicit duration is defined
    • 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.
    • channel

      public String channel()
      Returns the value of the channel record component.
      Returns:
      the value of the channel record component
    • channelScope

      public BattleAnimationChannelScope channelScope()
      Returns the value of the channelScope record component.
      Returns:
      the value of the channelScope record component
    • start

      public BattleAnimationTime start()
      Returns the value of the start record component.
      Returns:
      the value of the start record component
    • end

      public BattleAnimationTime end()
      Returns the value of the end record component.
      Returns:
      the value of the end record component
    • policy

      Returns the value of the policy record component.
      Returns:
      the value of the policy record component
    • blocksBattle

      public boolean blocksBattle()
      Returns the value of the blocksBattle record component.
      Returns:
      the value of the blocksBattle record component
    • clientAcknowledgement

      public BattleAnimationClientAcknowledgement clientAcknowledgement()
      Returns the value of the clientAcknowledgement record component.
      Returns:
      the value of the clientAcknowledgement record component
    • action

      public BattleAnimationAction action()
      Returns the value of the action record component.
      Returns:
      the value of the action record component