Class OpProgress<T extends Operable<T>>

java.lang.Object
rekit.primitives.operable.OpProgress<T>
Type Parameters:
T - the class / the Operable

public final class OpProgress<T extends Operable<T>> extends Object
Dynamically scale (linear) an Operable.
  • Constructor Summary

    Constructors
    Constructor
    Description
    OpProgress(Operable<T> start, Operable<T> end)
    Constructor that takes the start and end value for calculating values in between relative to a progress between 0 and 1.
  • Method Summary

    Modifier and Type
    Method
    Description
    getNow(float progress)
    Calculates a value between start and end in the same ratio as progress has to 0 and 1.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • OpProgress

      public OpProgress(Operable<T> start, Operable<T> end)
      Constructor that takes the start and end value for calculating values in between relative to a progress between 0 and 1.
      Parameters:
      start - the start value that will be returned for progress = 0
      end - the end value that will be returned for progress = 1
  • Method Details

    • getNow

      public T getNow(float progress)
      Calculates a value between start and end in the same ratio as progress has to 0 and 1. Has no defined behavior for other numbers.
      Parameters:
      progress - a value between 0 and 1 that defines the ratio
      Returns:
      the calculated value between start and end (inclusive)