Record Class TransitionPlayback.Segment<T>

java.lang.Object
java.lang.Record
me.deecaad.core.transition.TransitionPlayback.Segment<T>
Record Components:
tickOffset - Tick (relative to the transition's start) at which this segment begins.
interpolationDuration - Number of ticks the consumer should pass to native interpolation while reaching value. 0 = instant set.
value - The target value at tickOffset + interpolationDuration.
Enclosing class:
TransitionPlayback

public static record TransitionPlayback.Segment<T>(int tickOffset, int interpolationDuration, T value) extends Record
One step in a transition schedule.
  • Constructor Details

    • Segment

      public Segment(int tickOffset, int interpolationDuration, @NotNull T value)
      Creates an instance of a Segment record class.
      Parameters:
      tickOffset - the value for the tickOffset record component
      interpolationDuration - the value for the interpolationDuration record component
      value - the value for the value record component
  • Method Details

    • 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.
    • tickOffset

      public int tickOffset()
      Returns the value of the tickOffset record component.
      Returns:
      the value of the tickOffset record component
    • interpolationDuration

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

      @NotNull public T value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component