Class EffectStore
- Namespace
- SurvivorsMaker.Core
- Assembly
- SurvivorsMaker.Core.dll
Raw effect totals for one player, before stat base values and limits.
public sealed class EffectStore
- Inheritance
-
EffectStore
- Inherited Members
Constructors
EffectStore()
public EffectStore()
Fields
Entries
public readonly Dictionary<string, List<KeyValuePair<string, int>>> Entries
Field Value
IdLists
Id lists written by AppendUnique.
public readonly Dictionary<string, List<string>> IdLists
Field Value
Values
public readonly Dictionary<string, int> Values
Field Value
Properties
Revision
Incremented on every change, so callers can cache derived values.
public int Revision { get; }
Property Value
Methods
Clear()
Clears stat values and named entry/id lists.
public void Clear()
EntriesFor(string)
Returns the mutable named entry list, creating it when absent.
public List<KeyValuePair<string, int>> EntriesFor(string list)
Parameters
liststring
Returns
Get(string)
Reads integer stat storage; unknown or null ids return zero.
public int Get(string id)
Parameters
idstring
Returns
GetEntries(string)
Returns the current named entry-list view, or an empty view when absent.
public IReadOnlyList<KeyValuePair<string, int>> GetEntries(string list)
Parameters
liststring
Returns
GetIds(string)
Returns the current named id-list view, or an empty view when absent.
public IReadOnlyList<string> GetIds(string list)
Parameters
liststring
Returns
IdsFor(string)
Returns the mutable named id list, creating it when absent.
public List<string> IdsFor(string list)
Parameters
liststring
Returns
Total(string, string)
Sum of the amounts for one id in a list, e.g. how many copies of a weapon in a loadout.
public int Total(string list, string id)
Parameters
Returns
Touch()
Marks the store changed. Custom handlers call this after writing.
public void Touch()