Gears
API ReferenceAttributes

SettingFactoryAttribute

Registers a setting family implementation for one value type.

Sealed classNamespace GearsAPI.AttributesAssembly GearsAPI.dllSource
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Class, AllowMultiple = false)]
public sealed class SettingFactoryAttribute : Attribute

Registers a class as the implementation of a setting family for one value type, for example [SettingFactory(typeof(ISelectorGlobalSetting<>), typeof(int))].

Inheritance: Object → Attribute → SettingFactoryAttribute
Attributes: AttributeUsageAttribute

Reserved

Gears scans only its own assembly for this attribute, so it has no effect in a mod assembly.

Constructors

SettingFactoryAttribute(Type, Type)

public SettingFactoryAttribute(Type familyInterface, Type valueType)

Initializes the attribute with the open generic family interface and the value type.

Properties

FamilyInterface

public Type FamilyInterface { get; }

Gets the open generic setting interface, such as typeof(ISelectorGlobalSetting<>).

ValueType

public Type ValueType { get; }

Gets the value type the class implements the family for.

On this page