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

(id, amount) lists written by Tally and Append.

public readonly Dictionary<string, List<KeyValuePair<string, int>>> Entries

Field Value

Dictionary<string, List<KeyValuePair<string, int>>>

IdLists

Id lists written by AppendUnique.

public readonly Dictionary<string, List<string>> IdLists

Field Value

Dictionary<string, List<string>>

Values

Scalar values written by Add and Set.

public readonly Dictionary<string, int> Values

Field Value

Dictionary<string, int>

Properties

Revision

Incremented on every change, so callers can cache derived values.

public int Revision { get; }

Property Value

int

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

list string

Returns

List<KeyValuePair<string, int>>

Get(string)

Reads integer stat storage; unknown or null ids return zero.

public int Get(string id)

Parameters

id string

Returns

int

GetEntries(string)

Returns the current named entry-list view, or an empty view when absent.

public IReadOnlyList<KeyValuePair<string, int>> GetEntries(string list)

Parameters

list string

Returns

IReadOnlyList<KeyValuePair<string, int>>

GetIds(string)

Returns the current named id-list view, or an empty view when absent.

public IReadOnlyList<string> GetIds(string list)

Parameters

list string

Returns

IReadOnlyList<string>

IdsFor(string)

Returns the mutable named id list, creating it when absent.

public List<string> IdsFor(string list)

Parameters

list string

Returns

List<string>

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

list string
id string

Returns

int

Touch()

Marks the store changed. Custom handlers call this after writing.

public void Touch()