Table of Contents

Class BoolOption

Namespace
ConfigurableWarning.API.Options
Assembly
RedstoneWizard08.ContentLibrary.dll

A boolean option. This must be inherited from to use. Its state is stored in the OptionsState class.

public class BoolOption : BoolSetting, IDisposable, IOption<bool>, ICustomSetting, IExposedSetting, IUntypedOption, IHasStateHolder<bool>
Inheritance
BoolOption
Implements
Inherited Members

Constructors

BoolOption(string, bool, string)

Initialize a IOption<T> with the bool type.

protected BoolOption(string name, bool defaultValue, string displayName)

Parameters

name string

The option's name.

defaultValue bool

The default value.

displayName string

The option's displayed name.

BoolOption(string, bool, string, Action<BoolOption>[])

Initialize a IOption<T> with the bool type.

protected BoolOption(string name, bool defaultValue, string displayName, Action<BoolOption>[] actions)

Parameters

name string

The option's name.

defaultValue bool

The default value.

displayName string

The option's displayed name.

actions Action<BoolOption>[]

Functions to run when the value is applied.

Properties

State

Get or set this option's state.

public bool State { get; set; }

Property Value

bool

StateHolder

Get this object's state holder.

public StateHolder<bool> StateHolder { get; }

Property Value

StateHolder<bool>

The state holder.

Methods

ApplyValue()

Applies the value. This is run when the user changes the value. This will sync it, update the state, and run any apply actions.

public override void ApplyValue()

AsOption()

Get this as an IOption<T>. This is used for accessing default methods.

public IOption<bool> AsOption()

Returns

IOption<bool>

This as an IOption<T>.

AsUntyped()

Get this option as an IUntypedOption

public IUntypedOption AsUntyped()

Returns

IUntypedOption

The IUntypedOption form of this.

GetDefaultValue()

Get this option's default value.

public override bool GetDefaultValue()

Returns

bool

The option's default value.

GetDisplayName()

Get the display name of this option.

public 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.

public 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!

public bool GetValue()

Returns

bool

The (potential) value of this option.

Instance(string)

Get an instance of an option.

public static BoolOption? Instance(string name)

Parameters

name string

The option's name.

Returns

BoolOption

The option.

RegisterSetting(string, string)

Registers this setting with Content Settings. You probably want to use Register(string, string) instead.

public void RegisterSetting(string tab, string category)

Parameters

tab string

The tab to register to.

category string

The category this option belongs to.

SetValue(bool)

Sets the option's value. This will NOT update it in the state!

public void SetValue(bool value)

Parameters

value bool

The new value.

SetValue(object)

Sets the option's value. This will NOT update it in the state!

public void SetValue(object value)

Parameters

value object

The new value.