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>

TId
The config ID struct type (e.g. HeroCfgId).

TValue
The underlying unmanaged value type (e.g. long).

Inheritance Object → GUIDrawer → PropertyDrawer → CfgIdDrawer → IntCfgIdDrawer<TId, TValue>

public PropertyAttribute attribute { get; }

PropertyAttribute

public FieldInfo fieldInfo { get; }

FieldInfo

public string preferredLabel { get; }

String

protected IntCfgIdDrawer()
protected string GetHeader()

String

protected TValue[] GetIdValues()

TValue[]

protected String[] GetDisplayNames()

String[]

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

Section titled “Initialize(String, ICollection, 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
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.