Interface IConfigurationTraversalContext
The context under which a IConfigurationCollection or IInputTemplate may be traversed to yield an abstract syntax tree.
Namespace: Snowflake.Configuration.Serialization
Assembly: Snowflake.Framework.Primitives.dll
Syntax
public interface IConfigurationTraversalContext
Methods
TraverseCollection(IConfigurationCollection)
Traverses a IConfigurationCollection to yield a mapping of targets to ASTs formed by IAbstractConfigurationNode.
The special target #null is ignored and never traversed.
Declaration
IReadOnlyDictionary<string, IAbstractConfigurationNode<IReadOnlyList<IAbstractConfigurationNode>>> TraverseCollection(IConfigurationCollection collection)
Parameters
| Type | Name | Description |
|---|---|---|
| IConfigurationCollection | collection | The IConfigurationCollection with targets specified to traverse in order to yield an AST. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, IAbstractConfigurationNode<System.Collections.Generic.IReadOnlyList<IAbstractConfigurationNode>>> | A mapping of targets to IAbstractConfigurationNode<T> that represent the syntax tree that the target forms. |
TraverseCollection(IConfigurationCollection, IEnumerable<(String targetName, IAbstractConfigurationNode node)>)
Traverses a IConfigurationCollection to yield a mapping of targets to ASTs formed by IAbstractConfigurationNode.
The special target #null is ignored and never traversed.
Declaration
IReadOnlyDictionary<string, IAbstractConfigurationNode<IReadOnlyList<IAbstractConfigurationNode>>> TraverseCollection(IConfigurationCollection collection, IEnumerable<(string targetName, IAbstractConfigurationNode node)> extraNodes)
Parameters
| Type | Name | Description |
|---|---|---|
| IConfigurationCollection | collection | The IConfigurationCollection with targets specified to traverse in order to yield an AST. |
| System.Collections.Generic.IEnumerable<System.ValueTuple<System.String, IAbstractConfigurationNode>> | extraNodes | Extra nodes to attach to a specified target. |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.IReadOnlyDictionary<System.String, IAbstractConfigurationNode<System.Collections.Generic.IReadOnlyList<IAbstractConfigurationNode>>> | A mapping of targets to IAbstractConfigurationNode<T> that represent the syntax tree that the target forms. |
TraverseInputTemplate(IInputTemplate, IDeviceInputMapping, Int32, String)
Traverses a IInputTemplate under the context of an IDeviceInputMapping to yield an AST formed by IAbstractConfigurationNode.
Declaration
IAbstractConfigurationNode<IReadOnlyList<IAbstractConfigurationNode>> TraverseInputTemplate(IInputTemplate template, IDeviceInputMapping mapping, int index, string indexer = "{N}")
Parameters
| Type | Name | Description |
|---|---|---|
| IInputTemplate | template | The IInputTemplate to traverse in order to yield an AST. |
| IDeviceInputMapping | mapping | The string mappings for each valid ControllerElement in the IInputTemplate, which will be used in accordance to produce the AST. |
| System.Int32 | index | The player index that the input template is intended for. This player index is zero-indexed, so Player 1 will have an index of 0. |
| System.String | indexer | The special string that will be replaced with the player index as an integer. By default it is the string {N}, but can be overridden. |
Returns
| Type | Description |
|---|---|
| IAbstractConfigurationNode<System.Collections.Generic.IReadOnlyList<IAbstractConfigurationNode>> | The syntax tree that the given IInputTemplate forms, relative to the provided IDeviceInputMappings. |