HandStaminaManager
A class in Root.Township, Features.Climbing.
Per-hand climbing stamina: drains the hand's stamina stat while gripping and regenerates it while not, and asks for the hand shake-off detector while stamina is below full.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
IHandStaminaManager
Constructors
| Member | What it is |
|---|---|
HandStaminaManager(ClimbingHand climbingHand, Stat stamina, ClimbingHandler climbingHandler) | Creates a HandStaminaManager from climbingHand, stamina and climbingHandler. |
Fields
6 private and internal fields
| Member | What it is |
|---|---|
private ClimbingHand hand | The climbing hand this manager tracks. |
private ClimbingHandler handler | The climbing handler, source of the stamina settings. |
private HandShakeOffDetector handShake | Backing field for HandShake. |
private float lastClimbingtime | Real time this hand last gripped, passed to the regen formula. |
private Stat stamina | Backing field for Stamina. |
private const float StaminaToleranceForFloatComparisons | 0.01, used for the empty and full checks. |
Properties
| Member | What it is |
|---|---|
HandShakeOffDetector HandShake { get; } | The hand's shake-off detector, whose score feeds stamina regen. |
bool HasStamina { get; } | True while stamina is above 0.01. |
Stat Stamina { get; } | The stamina Stat this hand drains. |
Methods
| Member | What it is |
|---|---|
void Process() | Per-frame update: drains stamina by grip, layer and hanging multipliers, or regenerates it, then requests or releases the shake detector. |