Interface ISettingsClass<T>
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
Setting interface.
public interface ISettingsClass<T>
Type Parameters
T
The type of the given setting.
- Extension Methods
Properties
this[string]
Gets and sets the setting with the provided key.
T this[string key] { get; set; }
Parameters
key
stringThe key to the setting.
Property Value
- T
The current value of the given key.
Methods
AddWatcher(string, OnSettingsChanged<T>)
Setting watcher for changes in values for a given setting.
void AddWatcher(string key, OnSettingsChanged<T> OnValueChanged)
Parameters
key
stringKey to the setting
OnValueChanged
OnSettingsChanged<T>the OnValueChanged event fired.
Exists(string)
Does this setting exist?
bool Exists(string key)
Parameters
key
stringThe key to check on a setting.
Returns
- bool
Whether the setting exists or not.
Get(string, T)
Gets the setting with the provided key
T Get(string key, T defaultValue = default)
Parameters
key
stringdefaultValue
T
Returns
- T
RemoveWatcher(string, OnSettingsChanged<T>)
Removes a previously assigned watcher
bool RemoveWatcher(string key, OnSettingsChanged<T> handler)
Parameters
key
stringhandler
OnSettingsChanged<T>
Returns
- bool
True if successfully removed