SettingParserAttribute
Marks a static method as the parser for a value type.
[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)]
public sealed class SettingParserAttribute : AttributeMarks a static method inside a SettingsSerializationProvider class as the parser for a value type. The method must have the signature static T Method(string); a mismatch throws InvalidOperationException when Gears scans it. One parser is registered per value type across the whole game, and the last one scanned wins. Registering a type Gears already handles replaces its handler, and two mods registering the same type silently overwrite each other, so register only types your own mod owns.
Inheritance: Object → Attribute → SettingParserAttribute
Attributes: AttributeUsageAttribute
Declared in SettingsParserAttribute.cs — the file name carries an extra s that the type name does not.
Constructors
SettingParserAttribute(Type)
public SettingParserAttribute(Type valueType)Initializes the attribute for valueType.
Properties
ValueType
public Type ValueType { get; }Gets the type the method parses.
SettingsSerializationProvider
Marks a class as holding [SettingParserAttribute](/docs/reference/attributes/setting-parser-attribute) and [SettingFormatterAttribute](/docs/reference/attributes/setting-formatter-attribute) methods.
SettingFormatterAttribute
Marks a static method as the formatter for a value type.