ProjectVStaminaRecovery class
Live stamina countdown from ProjectVHeaderSnapshot.StaminaRecovery. Stamina keeps recovering between server updates, so call Read every frame or second to show the current value and countdown without asking the server again.
Namespace: SilverTiger.ProjectV.Unity.Presentation.Header
public sealed class ProjectVStaminaRecovery
Properties​
| Property | Type | Description |
|---|---|---|
Maximum | long | The stamina maximum. |
Methods​
Read(DateTimeOffset nowUtc)​
Works out stamina at nowUtc: adds the points recovered since the last server update, stopping at Maximum.
public ProjectVStaminaReading Read(DateTimeOffset nowUtc);
Parameters
| Name | Type | Description |
|---|---|---|
nowUtc | DateTimeOffset | The current time, normally DateTimeOffset.UtcNow. A time before the last update gives the last server value. |
Returns
ProjectVStaminaReading: The stamina to show and the countdowns. ProjectVStaminaReading.UntilNextPoint is null when stamina is full or does not recover.