Game.UI.Widgets.StringFieldBuilders
Assembly:
Assembly-CSharp (common assembly for game/mod code)
Namespace:
Game.UI.Widgets
Type:
public class
Base:
IFieldBuilderFactory
Summary:
Factory that creates FieldBuilder instances for string-typed fields. When asked to create a field builder for a member of type System.String, it returns a FieldBuilder for a StringInputField bound to string values via WidgetReflectionUtils.CreateFieldBuilder
Fields
- (none)
This class does not declare any instance or static fields.
Properties
- (none)
No public or private properties are defined on this class.
Constructors
public StringFieldBuilders()
Default parameterless constructor (compiler-generated if not explicitly declared). Creates an instance of the factory. No initialization logic is present in the class.
Methods
-
public FieldBuilder TryCreate(Type memberType, object[] attributes)
Attempts to create a FieldBuilder for the requested member type. -
Parameters:
memberType
— The System.Type of the member for which a field builder is requested.attributes
— An array of attribute instances applied to the member (not used by this implementation).
- Returns:
- A FieldBuilder instance created by
WidgetReflectionUtils.CreateFieldBuilder<StringInputField, string>()
whenmemberType
istypeof(string)
. null
whenmemberType
is notstring
.
- A FieldBuilder instance created by
- Behavior:
- This implementation only recognizes the string type and delegates construction to WidgetReflectionUtils to produce the proper FieldBuilder wiring a StringInputField to a string value.
- Attributes are ignored by this factory; if attribute-based behavior is required it would need to be implemented here.
Usage Example
// Create the factory
var factory = new Game.UI.Widgets.StringFieldBuilders();
// Request a FieldBuilder for a string member
FieldBuilder builder = factory.TryCreate(typeof(string), null);
if (builder != null)
{
// builder can now be used by the UI system to create/configure a StringInputField bound to a string value
}
Additional notes:
- The implementation depends on WidgetReflectionUtils.CreateFieldBuilder