Class ModOption<T, E>
The common generic-typed abstract class to all mod options.
public abstract class ModOption<T, E> : OptionItem where E : ConfigOptionEventArgs<T>
Type Parameters
T
E
- Inheritance
-
ModOption<T, E>
- Derived
- Inherited Members
- Extension Methods
Constructors
ModOption(string, string, T)
Base constructor for all typed mod options.
public ModOption(string label, string id, T value)
Parameters
label
string- The display text to show on the in-game menus.
id
string- The internal ID if this option.
value
T- The typed value of the OptionItem
Properties
Value
The value for the ModOption<T, E>.
public T Value { get; set; }
Property Value
- T
Methods
GetDelegates()
Gets the Invocation List for the OnChanged event or returns null if none present.
public IEnumerable<EventHandler<E>> GetDelegates()
Returns
OnChange(string, T)
Notifies an option change to all subscribed event handlers.
public void OnChange(string id, T value)
Parameters
id
stringvalue
T
Events
OnChanged
The event that is called whenever an option is changed.
public event EventHandler<E> OnChanged
Event Type
- EventHandler<E>