|
using System;
using System.Collections;
namespace GFramework
{
public class GNodeCollectionEnumerator : IEnumerator
{
#region Constructor
public GNodeCollectionEnumerator(GNodeCollectionBase collection)
{
m_Collection = collection;
}
#endregion
#region IEnumerator
public object Current
{
get
{
return m_CurrentNode;
}
}
public bool MoveNext()
{
if (m_MoveNextIterations >= 0 && m_MoveNextIterations < m_Collection.Count)
{
m_CurrentNode = m_Collection.m_Nodes[m_MoveNextIterations];
}
m_MoveNextIterations++;
return m_CurrentNode != null;
}
public void Reset()
{
m_CurrentNode = null;
m_MoveNextIterations = 0;
}
#endregion
#region Fields
internal int m_MoveNextIterations;
internal GNode m_CurrentNode;
internal GNodeCollectionBase m_Collection;
#endregion
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
.NET & C# addicted. Win8 & WinRT enthusiast and researcher @Telerik.