Class ImmutableCountdown
An immutable timer that is sycned with the client and doesn't require ticks.
Inheritance
System.Object
ImmutableCountdown
Assembly: Eco.Shared.dll
Syntax
[Serialized]
public sealed class ImmutableCountdown : ValueType
Constructors
ImmutableCountdown(Double, Double, Double)
Declaration
public ImmutableCountdown(double duration, double timeLeftIfPaused, double expirationTimeIfRunning)
Parameters
| Type |
Name |
Description |
| System.Double |
duration |
|
| System.Double |
timeLeftIfPaused |
|
| System.Double |
expirationTimeIfRunning |
|
Methods
Create(Double, Double, Boolean)
Creates ImmutableCountdown either paused or running with duration and timeLeft. timeLeft may exceed duration for over-value items (e.g. over-fresh food starts at >100%).
Declaration
public static ImmutableCountdown Create(double duration, double timeLeft, bool paused)
Parameters
| Type |
Name |
Description |
| System.Double |
duration |
|
| System.Double |
timeLeft |
|
| System.Boolean |
paused |
|
Returns
CreatePaused(Double)
Declaration
public static ImmutableCountdown CreatePaused(double duration)
Parameters
| Type |
Name |
Description |
| System.Double |
duration |
|
Returns
CreatePaused(Double, Double)
Declaration
public static ImmutableCountdown CreatePaused(double duration, double timeLeft)
Parameters
| Type |
Name |
Description |
| System.Double |
duration |
|
| System.Double |
timeLeft |
|
Returns
CreateRunning(Double, Double)
Declaration
public static ImmutableCountdown CreateRunning(double duration, double timeLeft)
Parameters
| Type |
Name |
Description |
| System.Double |
duration |
|
| System.Double |
timeLeft |
|
Returns
Duration()
Declaration
Returns
| Type |
Description |
| System.Double |
|
ExpirationTime()
Declaration
public double ExpirationTime()
Returns
| Type |
Description |
| System.Double |
|
Expired()
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
Paused()
Declaration
Returns
| Type |
Description |
| System.Boolean |
|
PercentComplete()
Declaration
public float PercentComplete()
Returns
| Type |
Description |
| System.Single |
|
PercentLeft()
Declaration
public float PercentLeft()
Returns
| Type |
Description |
| System.Single |
|
TimeLeft()
Declaration
Returns
| Type |
Description |
| System.Double |
|
TimeSpent()
Declaration
public double TimeSpent()
Returns
| Type |
Description |
| System.Double |
|
Extension Methods