Skip to content

IntCfgIdDrawer<TId, TValue>

Namespace: Shadop.Archmage.Sdk.Editor

Generic base for config ID property drawers. TId is the config ID struct type; TValue is the unmanaged numeric type of its underlying raw value. Manages the static ID-value and display-name arrays; subclasses populate them by calling Initialize.

public abstract class IntCfgIdDrawer<TId, TValue> : CfgIdDrawer<TValue>
where TValue : unmanaged, IComparable<TValue>

Inheritance ObjectPropertyDrawerCfgIdDrawer<TValue>IntCfgIdDrawer<TId, TValue>

Initialize(String, ICollection<TId>, Func<TId, TValue>, Func<TValue, String>)

Section titled “Initialize(String, ICollection<TId>, Func<TId, TValue>, Func<TValue, String>)”

Populates the static ID-value and display-name arrays from a table’s ID collection. Index 0 is reserved for a “0 (Default)” entry; remaining entries are sorted ascending.

protected static void Initialize(string header, ICollection<TId> ids, Func<TId, TValue> id2Value, Func<TValue, string> format)

header String
The header text displayed at the top of the dropdown window.

ids ICollection<TId>
The ID collection of the config table.

id2Value Func<TId, TValue>
Extracts the raw value from a config ID (e.g. id => id.Value).

format Func<TValue, String>
Formats a raw value into its display string.