Class ConfigLayout.Builder
Fluent builder for a ConfigLayout. Obtained from Create().
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public sealed class ConfigLayout.Builder
Remarks
The builder validates only what it can see locally: null and empty identifiers, duplicate IDs, and exclusion sets too small to mean anything. Whether a named map or action actually exists is checked by Initialize(ConfigLayout), which is the first point that has the action manager to check against.
Methods
Build()
Produces the immutable layout.
Declaration
public ConfigLayout Build()
Returns
| Type | Description |
|---|---|
| ConfigLayout | The built ConfigLayout. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when no column was declared. |
WithColumn(string)
Adds a column, taking its header from the binding group name.
Declaration
public ConfigLayout.Builder WithColumn(string groupName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupName | Binding group name as it appears in the Input Action Asset. |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
WithColumn(string, string)
Adds a column with a distinct header.
Declaration
public ConfigLayout.Builder WithColumn(string groupName, string displayName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupName | Binding group name as it appears in the Input Action Asset. |
| string | displayName | Column header. |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
WithColumn(string, string, string)
Adds a column with a distinct header and a device filter applied when capturing a new binding for it.
Declaration
public ConfigLayout.Builder WithColumn(string groupName, string displayName, string deviceFilter)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupName | Binding group name as it appears in the Input Action Asset. |
| string | displayName | Column header. |
| string | deviceFilter | Device path prefix such as |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the group name is null or empty, or already declared. |
WithExclusiveGroups(params string[])
Declares that the named groups are never active at the same time, so bindings they share are not conflicts.
Declaration
public ConfigLayout.Builder WithExclusiveGroups(params string[] groupIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| string[] | groupIDs | Two or more previously declared group IDs. |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when fewer than two groups are named, a name is null or empty, or a name is repeated within the set. |
WithExclusiveGroupsFromContexts(IInputContextManager)
Reads the exclusivity the game already declared on its input contexts and turns it into exclusion sets, so the same statement does not have to be made twice.
Declaration
public ConfigLayout.Builder WithExclusiveGroupsFromContexts(IInputContextManager contexts)
Parameters
| Type | Name | Description |
|---|---|---|
| IInputContextManager | contexts | The context manager holding the registered contexts, usually
|
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Remarks
Two declared groups become an exclusion set when every action map of the first is exclusive with every action map of the second, per AreMapsExclusive(IReadOnlyList<InputContext>, string, string). That test is driven by the contexts' ConflictExclusiveTags, so tagging a set of contexts in the context configuration asset is enough to keep this screen's Conflict column honest, with nothing restated in code.
Derived sets are ordinary ConfigGroupExclusion entries, indistinguishable from ones declared through WithExclusiveGroups(params string[]), and the two compose: call both and the results add up.
Groups declared through WithGroupOfActions(string, string, params string[]) name actions rather than maps, and a group with no maps cannot be resolved against the contexts, so those are skipped and named in a single log line rather than being silently treated as non-exclusive.
The derivation runs once, inside Build(), and reads the registered context definitions rather than the live context stack. A stack says what is enabled at this instant; the conflict question is about every state the game can reach, which is what the definitions describe.
WithExclusiveGroupsFromContexts(IReadOnlyList<InputContext>)
Derives exclusion sets from a list of contexts rather than from a manager.
Declaration
public ConfigLayout.Builder WithExclusiveGroupsFromContexts(IReadOnlyList<InputContext> contexts)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputContext> | contexts | The contexts, or |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Remarks
Same rule and same result as the manager overload; only the source differs. This is the edit-time path: an editor has the context configuration asset but no registered manager, and building one to ask a question about definitions would be a lot of machinery for a read.
Takes precedence over a manager supplied to the other overload, so calling both is not an error, and the more specific source wins.
WithGroup(string, string, params string[])
Adds a group whose membership is one or more action maps.
Declaration
public ConfigLayout.Builder WithGroup(string groupID, string displayName, params string[] actionMapIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupID | Stable identifier, used in exclusivity declarations. |
| string | displayName | Heading shown above this group's rows. |
| string[] | actionMapIDs | Action maps belonging to this group. |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the ID is null or empty, already declared, or no map is named. |
WithGroupOfActions(string, string, params string[])
Adds a group whose membership is an explicit list of actions, for groups that do not correspond to a whole action map.
Declaration
public ConfigLayout.Builder WithGroupOfActions(string groupID, string displayName, params string[] actionIDs)
Parameters
| Type | Name | Description |
|---|---|---|
| string | groupID | Stable identifier, used in exclusivity declarations. |
| string | displayName | Heading shown above this group's rows. |
| string[] | actionIDs | Actions belonging to this group, each named bare or as |
Returns
| Type | Description |
|---|---|
| ConfigLayout.Builder | This builder. |
Remarks
A bare action name takes the action of that name from every map that declares
one, which is what a group gathered by action is usually for. Where two maps
declare the same name and only one of them belongs here, write the name as
"MapID/ActionID" to take just that one.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | Thrown when the ID is null or empty, already declared, or no action is named. |