Class Progress

java.lang.Object
rekit.primitives.time.Progress

@ClassParser(ProgressParser.class) public final class Progress extends Object
Data class that holds an start and an end float. It can return the corresponding value in between in the same ratio as a given number progress to 0 and 1.
Author:
Angelo Aracri
  • Constructor Summary

    Constructors
    Constructor
    Description
    Progress(float start, float 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
    float
    getNow(float progress)
    Calculates a value between start and end in the same ratio as progress has to 0 and 1.
    boolean
    Returns true if start = end, which means there are no calculations required in getNow(float progress).

    Methods inherited from class java.lang.Object

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

    • Progress

      public Progress(float start, float 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 float 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)
    • isStatic

      public boolean isStatic()
      Returns true if start = end, which means there are no calculations required in getNow(float progress).
      Returns:
      true if getNows output never changes, false otherwise