Show / Hide Table of Contents

Class ImmutableCountdown

An immutable timer that is sycned with the client and doesn't require ticks.

Inheritance
System.Object
ImmutableCountdown
Namespace: Eco.Shared.Utils
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
Type Description
ImmutableCountdown

CreatePaused(Double)

Declaration
public static ImmutableCountdown CreatePaused(double duration)
Parameters
Type Name Description
System.Double duration
Returns
Type Description
ImmutableCountdown

CreatePaused(Double, Double)

Declaration
public static ImmutableCountdown CreatePaused(double duration, double timeLeft)
Parameters
Type Name Description
System.Double duration
System.Double timeLeft
Returns
Type Description
ImmutableCountdown

CreateRunning(Double, Double)

Declaration
public static ImmutableCountdown CreateRunning(double duration, double timeLeft)
Parameters
Type Name Description
System.Double duration
System.Double timeLeft
Returns
Type Description
ImmutableCountdown

Duration()

Declaration
public double Duration()
Returns
Type Description
System.Double

ExpirationTime()

Declaration
public double ExpirationTime()
Returns
Type Description
System.Double

Expired()

Declaration
public bool Expired()
Returns
Type Description
System.Boolean

Paused()

Declaration
public bool Paused()
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
public double TimeLeft()
Returns
Type Description
System.Double

TimeSpent()

Declaration
public double TimeSpent()
Returns
Type Description
System.Double

Extension Methods

CommandLine.FeedFromCommandLine(Object)
CommandLine.ToCommandLineArgs(Object, Func<Object, Boolean>)
ListUtil.DepthFirstTraversal<T>(T, Func<T, IEnumerable<T>>)
EnumerableExtensions.SingleItemAsEnumerable<T>(T)
EventUtils.RaiseEvent<TEventArgs>(Object, String, TEventArgs)
PredicateUtils.MatchesAll<TEnumerable, T>(T, TEnumerable)
PredicateUtils.MatchesAll<T>(T, Func<T, Boolean>[])
PredicateUtils.MatchesAny<TEnumerable, T>(T, TEnumerable)
ReflectionUtils.PropertyValue<T>(Object, PropertyInfo)
ReflectionUtils.TryGetPropertyValueByName<T>(Object, String, out T)
ReflectionUtils.GetPropertyValueByName<T>(Object, String)
ReflectionUtils.SetPropertyByName(Object, String, Object)
ReflectionUtils.GetStructPropertyByName<T>(Object, String)
ReflectionUtils.GetStringPropertyByName(Object, String)
ReflectionUtils.ZipByProperty<T>(Object, Object, Object, Func<T, T, T>)
☀
☾
In This Article
Back to top
Copyright (c) Strange Loop Games 2021
☀
☾