Class SceneFinderExtensions
Various extensions methods to find nodes or components within trees of scene nodes.
Inheritance
Inherited Members
Namespace: Fusee.Xene
Assembly: Fusee.Xene.dll
Syntax
public static class SceneFinderExtensions
Methods
FindComponents<TNode, TComponent>(TNode, Predicate<TComponent>)
Finds components matching the given search predicate within a tree.
Declaration
public static IEnumerable<TComponent> FindComponents<TNode, TComponent>(this TNode root, Predicate<TComponent> match)
where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the search. |
System.Predicate<TComponent> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TComponent> | All components matching the predicate. |
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes making up the tree. |
TComponent | The type of component to find. |
FindComponents<TNode, TComponent>(IEnumerable<TNode>, Predicate<TComponent>)
Finds components matching the given search predicate within a list of trees.
Declaration
public static IEnumerable<TComponent> FindComponents<TNode, TComponent>(this IEnumerable<TNode> rootList, Predicate<TComponent> match)
where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TComponent> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TComponent> | All components matching the predicate. |
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes making up the tree. |
TComponent | The type of component to find. |
FindComponents<TComponentToFind, TNode, TComponent>(TNode, Predicate<TComponentToFind>)
Finds components of a certain (sub-)type matching the given search predicate within a tree.
Declaration
public static IEnumerable<TComponentToFind> FindComponents<TComponentToFind, TNode, TComponent>(this TNode root, Predicate<TComponentToFind> match)
where TComponentToFind : class, TComponent where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the search. |
System.Predicate<TComponentToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TComponentToFind> | All components matching the predicate. |
Type Parameters
Name | Description |
---|---|
TComponentToFind | The type of the components to find. |
TNode | The type of nodes making up the tree. |
TComponent | The base type of components used in the given hierarchy. |
FindComponents<TComponentToFind, TNode, TComponent>(IEnumerable<TNode>, Predicate<TComponentToFind>)
Finds components of a certain (sub-)type matching the given search predicate within a list of trees.
Declaration
public static IEnumerable<TComponentToFind> FindComponents<TComponentToFind, TNode, TComponent>(this IEnumerable<TNode> rootList, Predicate<TComponentToFind> match)
where TComponentToFind : class, TComponent where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TComponentToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TComponentToFind> | All components matching the predicate. |
Type Parameters
Name | Description |
---|---|
TComponentToFind | The type of the components to find. |
TNode | The type of nodes making up the tree. |
TComponent | The base type of components used in the given hierarchy. |
FindNodes<TNode>(TNode, Predicate<TNode>)
Creates an enumerable traversing the tree starting with the given node.
Declaration
public static IEnumerable<TNode> FindNodes<TNode>(this TNode root, Predicate<TNode> match)
where TNode : class, INode
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the traversal. |
System.Predicate<TNode> | match | The matching predicate. Enumeration will yield on every matching node. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | An enumerable that can be used in foreach statements. |
Type Parameters
Name | Description |
---|---|
TNode | The node base type used in the current tree. Inferred by the instance this method is called upon. |
FindNodes<TNode>(IEnumerable<TNode>, Predicate<TNode>)
Finds nodes matching the given search predicate within a list of trees.
Declaration
public static IEnumerable<TNode> FindNodes<TNode>(this IEnumerable<TNode> rootList, Predicate<TNode> match)
where TNode : class, INode
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TNode> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | All nodes matching the predicate. |
Type Parameters
Name | Description |
---|---|
TNode | The node base type used in the current tree. Inferred by the instance this method is called upon. |
FindNodes<TNodeToFind, TNode>(TNode, Predicate<TNodeToFind>)
Finds nodes of a certain type and matching the given search predicate within a tree of nodes.
Declaration
public static IEnumerable<TNodeToFind> FindNodes<TNodeToFind, TNode>(this TNode root, Predicate<TNodeToFind> match)
where TNodeToFind : TNode where TNode : class, INode
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the search. |
System.Predicate<TNodeToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNodeToFind> | All nodes of the specified type matching the predicate. |
Type Parameters
Name | Description |
---|---|
TNodeToFind | The type of nodes to find. |
TNode | The node base type used in the current tree. Inferred by the instance this method is called upon. |
FindNodes<TNodeToFind, TNode>(IEnumerable<TNode>, Predicate<TNodeToFind>)
Finds nodes of a certain type and matching the given search predicate within a list of trees.
Declaration
public static IEnumerable<TNodeToFind> FindNodes<TNodeToFind, TNode>(this IEnumerable<TNode> rootList, Predicate<TNodeToFind> match)
where TNodeToFind : TNode where TNode : class, INode
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TNodeToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNodeToFind> | All nodes of the specified type matching the predicate. |
Type Parameters
Name | Description |
---|---|
TNodeToFind | The type of nodes to find. |
TNode | The node base type used in the current tree. Inferred by the instance this method is called upon. |
FindNodesWhereComponent<TNode, TComponent>(TNode, Predicate<TComponent>)
Finds all nodes containing one or more components matching a given search predicate within a tree of nodes.
Declaration
public static IEnumerable<TNode> FindNodesWhereComponent<TNode, TComponent>(this TNode root, Predicate<TComponent> match)
where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the search. |
System.Predicate<TComponent> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | All nodes containing matching components. |
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes making up the tree. |
TComponent | The type of component to find. |
FindNodesWhereComponent<TNode, TComponent>(IEnumerable<TNode>, Predicate<TComponent>)
Finds all nodes containing one or more components matching a given search predicate within a list of trees of nodes.
Declaration
public static IEnumerable<TNode> FindNodesWhereComponent<TNode, TComponent>(this IEnumerable<TNode> rootList, Predicate<TComponent> match)
where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TComponent> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | All nodes containing matching components. |
Type Parameters
Name | Description |
---|---|
TNode | The type of nodes making up the tree. |
TComponent | The type of component to find. |
FindNodesWhereComponent<TComponentToFind, TNode, TComponent>(TNode, Predicate<TComponentToFind>)
Finds all nodes containing one or more components matching a given search predicate within a tree of nodes.
Declaration
public static IEnumerable<TNode> FindNodesWhereComponent<TComponentToFind, TNode, TComponent>(this TNode root, Predicate<TComponentToFind> match)
where TComponentToFind : class, TComponent where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
TNode | root | The root node where to start the search. |
System.Predicate<TComponentToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | All nodes containing matching components. |
Type Parameters
Name | Description |
---|---|
TComponentToFind | The type of the components to find. |
TNode | The type of nodes making up the tree. |
TComponent | The base type of components used in the given hierarchy. |
FindNodesWhereComponent<TComponentToFind, TNode, TComponent>(IEnumerable<TNode>, Predicate<TComponentToFind>)
Finds all nodes containing one or more components matching a given search predicate within a list of trees of nodes.
Declaration
public static IEnumerable<TNode> FindNodesWhereComponent<TComponentToFind, TNode, TComponent>(this IEnumerable<TNode> rootList, Predicate<TComponentToFind> match)
where TComponentToFind : class, TComponent where TNode : class, INode where TComponent : class, IComponent
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The list of root nodes of the trees to search in. |
System.Predicate<TComponentToFind> | match | The search predicate. Typically specified as a Lambda expression. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TNode> | All nodes containing matching components. |
Type Parameters
Name | Description |
---|---|
TComponentToFind | The type of the components to find. |
TNode | The type of nodes making up the tree. |
TComponent | The base type of components used in the given hierarchy. |