Class ContextConflictScope
Scopes conflicts by the input contexts the game registered, treating each action map as its own scope.
Implements
Inherited Members
Namespace: Scylla.Input
Assembly: ScyllaInput.dll
Syntax
public sealed class ContextConflictScope : IInputConflictScope
Remarks
Where ConfigLayoutConflictScope reads a declaration written for a controls screen, this one reads the contexts the game actually switches between at run time. Two maps that no single context enables together, and whose enabling contexts are tagged mutually exclusive, are alternatives rather than rivals: a control they share is one key reused across two modes.
The scope key is the action map's name, not an abstract identifier.
InputContextExclusivity matches against
EnabledActionMaps, which holds names. That costs nothing
today because MapID is assigned the Unity map's
name, but the two are not the same concept and a future change to MapID would
silently stop this scope from resolving anything.
The context list is a settable property rather than a manager reference, so a caller reads the contexts once and every comparison in that query sees the same set. That also keeps the type testable with a plain list, and independent of whether the context manager happens to cache.
There is deliberately no null check.
AreMapsExclusive(IReadOnlyList<InputContext>, string, string) already answers false for
a null or empty context list and for an empty map name, so an unconfigured scope
reports every overlap. That is the conservative direction and it reproduces what the
binding manager does when no context manager was supplied.
Constructors
ContextConflictScope(IReadOnlyList<InputContext>)
Initializes a scope over a set of contexts.
Declaration
public ContextConflictScope(IReadOnlyList<InputContext> contexts)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyList<InputContext> | contexts | The contexts, or |
Properties
Contexts
Gets or sets the contexts consulted. null or empty makes everything collide.
Declaration
public IReadOnlyList<InputContext> Contexts { get; set; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyList<InputContext> |
Remarks
Reassign this at the start of a query rather than holding a manager, so the whole query sees one set. Note that reassigning does not clear the engine's memoized verdicts; assign Scope for that.
Methods
CanScopesCollide(string, string)
Reports whether two scope keys name states that can be live simultaneously.
Declaration
public bool CanScopesCollide(string scopeA, string scopeB)
Parameters
| Type | Name | Description |
|---|---|---|
| string | scopeA | First scope key. |
| string | scopeB | Second scope key. |
Returns
| Type | Description |
|---|---|
| bool |
|
Remarks
Returning true is the conservative answer: it reports the overlap and lets
a human decide. An implementation that cannot tell should say true.