Interface IOption<T>
- Namespace
- ConfigurableWarning.API.Options
- Assembly
- RedstoneWizard08.ContentLibrary.dll
Represents an option. This interface is implemented by all options.
public interface IOption<T> : ICustomSetting, IExposedSetting, IUntypedOption, IHasStateHolder<T>
Type Parameters
T
The option's value type.
- Inherited Members
Properties
State
Get or set this option's state.
T? State { get; set; }
Property Value
- T
Methods
AsOption()
Get this as an IOption<T>. This is used for accessing default methods.
IOption<T> AsOption()
Returns
- IOption<T>
This as an IOption<T>.
AsUntyped()
Get this option as an IUntypedOption
IUntypedOption AsUntyped()
Returns
- IUntypedOption
The IUntypedOption form of this.
GetDefaultValue()
Get this option's default value.
T GetDefaultValue()
Returns
- T
The option's default value.
GetDisplayName()
Get the display name of this option.
string GetDisplayName()
Returns
- string
The option's display name.
GetName()
Gets this option's name. This is its name in the registry and in the state holder.
string GetName()
Returns
- string
The option's name.
GetValue()
Gets the current value of the option. WARNING! THIS MAY NOT ALWAYS BE CORRECT! USE THE STATE HOLDER INSTEAD!
T GetValue()
Returns
- T
The (potential) value of this option.
Instance(string)
Get an instance of an option.
public static IOption<T>? Instance(string name)
Parameters
name
stringThe option's name.
Returns
- IOption<T>
The option.
Register(string, string)
Registers this option to Content Settings, sets up its state, and registers it to the OptionManager.
void Register(string tab, string category)
Parameters
RegisterSetting(string, string)
Registers this setting with Content Settings. You probably want to use Register(string, string) instead.
void RegisterSetting(string tab, string category)
Parameters
SetValue(T)
Sets the option's value. This will NOT update it in the state!
void SetValue(T value)
Parameters
value
TThe new value.