first time poster so forgive me if my formatting is off or anything :)
I'm working on my game engine in C# using XNA but when I check the name of a new node against existing nodes, the Assert fires off unpredictably even when there is no matching name in the list. Here is the code I'm referring too:
public void CheckNameIsUnique(string cName)
{
for (int i = 0; i < m_aNodeList.Count; ++i)
{
Debug.Assert(m_aNodeList[i].GetName().Equals(cName),
"USE OF NON-UNIQUE NAME: " + cName);
}
}
The assert will fire off -for example- when checking, "box1" and the only node in the list has the name "RootNode".
I get the same unpredictable results using:
string == string and string.CompareTo(string) > 0
Any ideas? =\