Package rekit.primitives.time
Class Progress
java.lang.Object
rekit.primitives.time.Progress
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
ConstructorsConstructorDescriptionProgress
(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
-
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 = 0end
- 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
-