Class ObservedThreshold
- Namespace
- Gamelogic.Extensions
- Assembly
- Gamelogic.Extensions.dll
Tracks a floating value and raises an event when it crosses a given threshold.
[Version(4, 5, 0)]
public class ObservedThreshold
- Inheritance
-
ObservedThreshold
- Inherited Members
- Extension Methods
Constructors
- ObservedThreshold(float, float, Func<float, float>)
Creates a new observed threshold that watches a value and notifies when it crosses the given threshold. An optional transform function can be applied before comparison.
Properties
- Value
The current value being observed.
Events
- ThresholdCrossed
Raised when the value goes from below to above the threshold, or from above to below. The event passes the new state (true = below threshold).