Class StatWallet
- Namespace
- SurvivorsMaker.Core
- Assembly
- SurvivorsMaker.Core.dll
Per-combat net ledger. Income statistics and pending net settlement are intentionally separate.
public sealed class StatWallet : IStatDebitSource, IStatSource
- Inheritance
-
StatWallet
- Implements
- Inherited Members
Constructors
StatWallet(int, int)
public StatWallet(int baseBalance, int minimumBalance = 0)
Parameters
Properties
Balance
public int Balance { get; }
Property Value
BaseBalance
public int BaseBalance { get; }
Property Value
Income
public long Income { get; }
Property Value
IsSettled
public bool IsSettled { get; }
Property Value
MinimumBalance
public int MinimumBalance { get; }
Property Value
NetChange
public int NetChange { get; }
Property Value
Revision
Revision stamp for reported source values; change it whenever those values change.
public long Revision { get; }
Property Value
Methods
TryCredit(int)
Credits nonnegative integer currency within wallet bounds; failure leaves balance unchanged.
public bool TryCredit(int amount)
Parameters
amountint
Returns
TryDebit(string, float)
Atomically debits available currency for the currency source key; failure leaves balance unchanged.
public bool TryDebit(string key, float amount)
Parameters
Returns
TryGet(string, out float)
Reads the currency balance for the currency source key; unknown keys return false.
public bool TryGet(string key, out float value)
Parameters
Returns
TrySettle(out int)
Caller applies netDelta once, replacing the old gross-income settlement path.
public bool TrySettle(out int netDelta)
Parameters
netDeltaint