Table of Contents

Class ConfigToSettingsExtensions

Namespace
MonkeyLoader.Resonite.DataFeeds.Settings
Assembly
MonkeyLoader.Resonite.Integration.dll

Contains extension methods to generate data feed items that represent config keys in data feeds - in particular, for the FrooxEngine.SettingsDataFeed.

public static class ConfigToSettingsExtensions
Inheritance
ConfigToSettingsExtensions
Inherited Members

Methods

EnumerateDefaultItemsAsync(ConfigSection, IReadOnlyList<string>, IReadOnlyList<string>, string?, object?)

Enumerates the default data feed items - as opposed to the custom items - for this config section.

public static IAsyncEnumerable<DataFeedItem> EnumerateDefaultItemsAsync(this ConfigSection configSection, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys, string? searchPhrase = null, object? viewData = null)

Parameters

configSection ConfigSection

The config section to enumerate the default items for.

path IReadOnlyList<string>

The path of the items being enumerated.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the items should be placed in.

searchPhrase string

The search phrase for the enumeration request.

viewData object

The custom view data for the enumeration request.

Returns

IAsyncEnumerable<DataFeedItem>

A sequence of the default data feed items for this config section.

Remarks

Config keys in subgroups are handled automatically using the SubgroupGenerator, and those with custom data feed items will use those.

EnumerateDefaultItemsAsync<T>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>)

Enumerates the default data feed items - as opposed to the custom items - for this config key.

public static IAsyncEnumerable<DataFeedItem> EnumerateDefaultItemsAsync<T>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys)

Parameters

configKey IDefiningConfigKey<T>

The config key to enumerate the default items for.

path IReadOnlyList<string>

The path of the items being enumerated.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the items should be placed in.

Returns

IAsyncEnumerable<DataFeedItem>

A sequence of the default data feed items for this config key.

Type Parameters

T

Remarks

This will automatically pick the right data feed item(s) to represent the config key.

EnumerateItemsAsync(ConfigSection, IReadOnlyList<string>, IReadOnlyList<string>, string?, object?)

Gets the data feed items that represent this config key.

public static IAsyncEnumerable<DataFeedItem> EnumerateItemsAsync(this ConfigSection configSection, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys, string? searchPhrase = null, object? viewData = null)

Parameters

configSection ConfigSection

The config section to enumerate the default or custom items for.

path IReadOnlyList<string>

The path of the items being enumerated.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the items should be placed in.

searchPhrase string

The search phrase for the enumeration request.

viewData object

The custom view data for the enumeration request.

Returns

IAsyncEnumerable<DataFeedItem>

The custom items for this config section if it has a custom items implementation; otherwise, the default items.

Remarks

Do not use this method on the config section that you are implementing a custom items for.
Use configSection.EnumerateDefaultItemsAsync(path, groupKeys, searchPhrase, viewData) instead to avoid infinite recursion and a stack overflow.

EnumerateItemsAsync<T>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>, string?, object?)

Gets the data feed items that represent this config key.

public static IAsyncEnumerable<DataFeedItem> EnumerateItemsAsync<T>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys, string? searchPhrase = null, object? viewData = null)

Parameters

configKey IDefiningConfigKey<T>

The config key to enumerate the default or custom items for.

path IReadOnlyList<string>

The path of the items being enumerated.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the items should be placed in.

searchPhrase string

The search phrase for the enumeration request.

viewData object

The custom view data for the enumeration request.

Returns

IAsyncEnumerable<DataFeedItem>

The custom items for this config key if it has a custom items component; otherwise, the default items.

Type Parameters

T

Remarks

Do not use this method on the config key that you are implementing a custom items component for.
Use configKey.EnumerateDefaultItemsAsync(path, groupKeys) instead to avoid infinite recursion and a stack overflow.

MakeEnum<E>(IDefiningConfigKey<E?>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates an enum item for this config key.

public static DataFeedEnum<E> MakeEnum<E>(this IDefiningConfigKey<E?> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys) where E : unmanaged, Enum

Parameters

configKey IDefiningConfigKey<E?>

The config key to create an enum item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedEnum<E>

The enum item for this config key.

Type Parameters

E

The type of the enum.

Remarks

This is not suitable for flags-enums.
Use configKey.EnumerateDefaultItemsAsync(path, groupKeys) instead.

MakeEnum<E>(IDefiningConfigKey<E>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates an enum item for this config key.

public static DataFeedEnum<E> MakeEnum<E>(this IDefiningConfigKey<E> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys) where E : unmanaged, Enum

Parameters

configKey IDefiningConfigKey<E>

The config key to create an enum item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedEnum<E>

The enum item for this config key.

Type Parameters

E

The type of the enum.

Remarks

This is not suitable for flags-enums.
Use configKey.EnumerateDefaultItemsAsync(path, groupKeys) instead.

MakeIndicator<T>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates an indicator item for this config key.

public static DataFeedIndicator<T> MakeIndicator<T>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys)

Parameters

configKey IDefiningConfigKey<T>

The config key to create a indicator item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedIndicator<T>

The indicator item for this config key.

Type Parameters

T

The type of the config key and indicator.

Remarks

So far, these only work for strings.

MakeQuantityField<T, TQuantity>(IDefiningConfigKey<T>, IConfigKeyQuantity<T>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates an quantity field item for this config key, using the given quantity component for the configuration.

public static DataFeedQuantityField<TQuantity, T> MakeQuantityField<T, TQuantity>(this IDefiningConfigKey<T> configKey, IConfigKeyQuantity<T> quantity, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys) where TQuantity : unmanaged, IQuantity<TQuantity>

Parameters

configKey IDefiningConfigKey<T>

The config key to create a quantity field item for.

quantity IConfigKeyQuantity<T>

The quantity component defining the configuration.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedQuantityField<TQuantity, T>

The quantity field item for this config key.

Type Parameters

T

The type of the config key and quantity field's input.

TQuantity

The kind of quantity.

Remarks

So far, these only work with numeric values, i.e. int, float and double.

MakeQuantityField<T, TQuantity>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>, T, T, UnitConfiguration, UnitConfiguration?)

Creates an quantity field item for this config key, using the given parameters for the configuration.

public static DataFeedQuantityField<TQuantity, T> MakeQuantityField<T, TQuantity>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys, T min, T max, UnitConfiguration defaultConfiguration, UnitConfiguration? imperialConfiguration = null) where TQuantity : unmanaged, IQuantity<TQuantity>

Parameters

configKey IDefiningConfigKey<T>

The config key to create a quantity field item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

min T

The lower bound for the quantity field.

max T

The upper bound for the quantity field.

defaultConfiguration UnitConfiguration

The default unit configuration for the quantity field.

imperialConfiguration UnitConfiguration

The optional imperial unit configuration for the quantity field.

Returns

DataFeedQuantityField<TQuantity, T>

The quantity field item for this config key.

Type Parameters

T

The type of the config key and quantity field's input.

TQuantity

The kind of quantity.

Remarks

So far, these only work with numeric values, i.e. int, float and double.

MakeSlider<T>(IDefiningConfigKey<T>, IConfigKeyRange<T>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates a slider item for this config key, using the given range component for the configuration.

public static DataFeedSlider<T> MakeSlider<T>(this IDefiningConfigKey<T> configKey, IConfigKeyRange<T> range, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys)

Parameters

configKey IDefiningConfigKey<T>

The config key to create a slider item for.

range IConfigKeyRange<T>

The range component defining the configuration.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedSlider<T>

The slider item for this config key.

Type Parameters

T

The type of the config key and slider.

Remarks

So far, these only work with numeric values, i.e. int, float and double.

MakeSlider<T>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>, T, T)

Creates a slider item for this config key, using the given parameters for the configuration.

public static DataFeedSlider<T> MakeSlider<T>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys, T min, T max)

Parameters

configKey IDefiningConfigKey<T>

The config key to create a slider item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

min T

The lower bound for the slider.

max T

The upper bound for the slider.

Returns

DataFeedSlider<T>

The slider item for this config key.

Type Parameters

T

The type of the config key and slider.

Remarks

So far, these only work with numeric values, i.e. int, float and double.

MakeToggle(IDefiningConfigKey<bool>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates a toggle item for this config key.

public static DataFeedToggle MakeToggle(this IDefiningConfigKey<bool> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys)

Parameters

configKey IDefiningConfigKey<bool>

The config key to create a toggle item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedToggle

The toggle item for this config key.

MakeValueField<T>(IDefiningConfigKey<T>, IReadOnlyList<string>, IReadOnlyList<string>)

Creates a value field item for this config key.

public static DataFeedValueField<T> MakeValueField<T>(this IDefiningConfigKey<T> configKey, IReadOnlyList<string> path, IReadOnlyList<string> groupKeys)

Parameters

configKey IDefiningConfigKey<T>

The config key to create a value field item for.

path IReadOnlyList<string>

The path of the item being created.

groupKeys IReadOnlyList<string>

The group keys for the outer container that the item should be placed in.

Returns

DataFeedValueField<T>

The value field item for this config key.

Type Parameters

T

WithEnabledSource<TDataFeedItem>(TDataFeedItem, IDefiningConfigKey<bool>)

Initializes the enabled field of this data feed item by synchronizing it with the given boolean config key.

public static TDataFeedItem WithEnabledSource<TDataFeedItem>(this TDataFeedItem feedItem, IDefiningConfigKey<bool> enabledSource) where TDataFeedItem : DataFeedItem

Parameters

feedItem TDataFeedItem

The data feed item being initialized.

enabledSource IDefiningConfigKey<bool>

The boolean config key to synchronize this data feed item's enabled field with.

Returns

TDataFeedItem

This data feed item.

Type Parameters

TDataFeedItem

The type of the data feed item being initialized.

WithEnabledState<TDataFeedItem>(TDataFeedItem, bool)

Initializes the enabled field of this data feed item by setting it to the given enabled state.

public static TDataFeedItem WithEnabledState<TDataFeedItem>(this TDataFeedItem feedItem, bool enabled) where TDataFeedItem : DataFeedItem

Parameters

feedItem TDataFeedItem

The data feed item being initialized.

enabled bool

The enabled state to set this data feed item's enabled field to.

Returns

TDataFeedItem

This data feed item.

Type Parameters

TDataFeedItem

The type of the data feed item being initialized.