Skip to content
Concord

Class ExtendedEnumRegistry

Namespace
Concord
Assembly
Concord.Enums.dll

Reads extended enum declarations, allocates member values, and assigns the declaration fields.

public static class ExtendedEnumRegistry
Inheritance
ExtendedEnumRegistry
Inherited Members

Methods

ExtendedEnums()

Every enum a declaration has added members to. An adapter walks this to register consumers for exactly the enums in play, rather than guessing a list up front.

public static IReadOnlyCollection<Type> ExtendedEnums()

Returns

IReadOnlyCollection<Type>

The extended enum types.

Extends(Type)

Whether any declaration has added members to this enum. Detours call this first, so an unextended enum pays one dictionary lookup and nothing else.

public static bool Extends(Type enumType)

Parameters

enumType Type

The enum to test.

Returns

bool

true when the enum has added members.

Reload(IReadOnlyDictionary<string, long>)

Replaces the in-memory map with a saved one and reassigns every member field. A runtime adapter calls this when it loads saved state, so a save written under a different mod set restores the values it recorded rather than the ones this session allocated.

public static void Reload(IReadOnlyDictionary<string, long> saved)

Parameters

saved IReadOnlyDictionary<string, long>

The saved id-to-value pairs.

UseStore(IEnumValueStore)

Registers the adapter storage that persists the id-to-value map. Without one, values live in memory only and are not stable across runs.

public static void UseStore(IEnumValueStore valueStore)

Parameters

valueStore IEnumValueStore

The adapter's storage.