Class RunStatSource

Namespace
SurvivorsMaker.Run
Assembly
SurvivorsMaker.Run.dll

Read-only inventory queries plus an atomic currency debit. Definition identity follows Run contracts. Currency reads the committed run balance unless Wallet is supplied (combat must supply its net ledger).

public sealed class RunStatSource : IStatDebitSource, IStatSource, IStatSourceDependencies
Inheritance
RunStatSource
Implements
Inherited Members

Constructors

RunStatSource(RunState)

public RunStatSource(RunState run)

Parameters

run RunState

Fields

Wallet

Optional shared combat wallet; key "currency" must include uncommitted net transactions.

public IStatDebitSource Wallet

Field Value

IStatDebitSource

Properties

Revision

Revision stamp for reported source values; change it whenever those values change.

public long Revision { get; }

Property Value

long

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

key string
into List<string>

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

key string
amount float

Returns

bool

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)

Parameters

key string
value float

Returns

bool