Class ViseratorBase<TItem, TNode, TComponent>
Extract of the final Viserator without everything State related. This class is necessary to be able to define extension methods on node lists. Do not use this class directly.
Implements
Inherited Members
Namespace: Fusee.Xene
Assembly: Fusee.Xene.dll
Syntax
public abstract class ViseratorBase<TItem, TNode, TComponent> : Visitor<TNode, TComponent>, IEnumerator<TItem>, IEnumerator, IDisposable where TNode : class, INode where TComponent : class, IComponent
Type Parameters
Name | Description |
---|---|
TItem | The type of the result list items to be returned by a Viserator traversal. |
TNode | The base type of nodes making up the tree. |
TComponent | The base type of the components the tree is made up of. |
Constructors
ViseratorBase()
Initializes a new instance of the ViseratorBase<TItem, TNode, TComponent> class.
Declaration
public ViseratorBase()
Properties
Current
Gets the element in the collection at the current position of the enumerator.
Declaration
public TItem Current { get; }
Property Value
Type | Description |
---|---|
TItem |
Methods
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()
Dispose(Boolean)
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
protected virtual void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing | If disposing equals true, the method has been called directly or indirectly by a user's code. Managed and unmanaged resources can be disposed. If disposing equals false, the method has been called by the runtime from inside the finalizer and you should not reference other objects. Only unmanaged resources can be disposed. |
Init(IEnumerable<TNode>)
Initializes this instance with the specified tree.
Declaration
protected virtual void Init(IEnumerable<TNode> rootList)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<TNode> | rootList | The tree to traverse. |
MoveNext()
Advances the enumerator to the next element of the collection.
Declaration
public bool MoveNext()
Returns
Type | Description |
---|---|
System.Boolean | true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. |
Reset()
Sets the enumerator to its initial position, which is before the first element in the collection.
Declaration
public void Reset()
Viserate()
Start the traversal on the tree hosted by this instance.
Declaration
public IEnumerable<TItem> Viserate()
Returns
Type | Description |
---|---|
System.Collections.Generic.IEnumerable<TItem> | The items yielded during iteration. |
YieldItem(TItem)
Call this method in visitor methods of derived Viserator classes to signal that an item should be propagated to the traversal's result enumeration.
Declaration
protected void YieldItem(TItem item)
Parameters
Type | Name | Description |
---|---|---|
TItem | item | The item. |
Explicit Interface Implementations
IEnumerator.Current
Declaration
object IEnumerator.Current { get; }
Returns
Type | Description |
---|---|
System.Object |