Class SimStatSource
- Namespace
- SurvivorsMaker.Simulation
- Assembly
- SurvivorsMaker.Simulation.dll
External stat inputs are read-only; missing health declares its maximum-health dependency.
public sealed class SimStatSource : IStatDebitSource, IStatSource, IStatSourceDependencies
- Inheritance
-
SimStatSource
- Implements
- Inherited Members
Constructors
SimStatSource(SimWorld, IStatSource)
public SimStatSource(SimWorld world, IStatSource fallback = null)
Parameters
worldSimWorldfallbackIStatSource
Properties
Revision
Revision stamp for reported source values; change it whenever those values change.
public long Revision { get; }
Property Value
Methods
GetDependencies(string, List<string>)
Reports stat ids used to derive an external source into the reusable output list; must not mutate gameplay.
public void GetDependencies(string key, List<string> into)
Parameters
TryDebit(string, float)
Atomically spends a nonnegative amount from a source; false must leave its state unchanged.
public bool TryDebit(string key, float amount)
Parameters
Returns
TryGet(string, out float)
Reads a stable external source value without side effects; false means the key is not supplied.
public bool TryGet(string key, out float value)