Exemplo n.º 1
0
//-----------------------------------------------------------------------------
// Purpose: Begins a depth-first search of the map heirarchy.
// Input  : pos - An iterator 
// Output : CMapClass
//-----------------------------------------------------------------------------
CMapClass *CMapClass::GetFirstDescendent(EnumChildrenPos_t &pos)
{
	pos.nDepth = 0;

	pos.Stack[0].pParent = this;
	pos.Stack[0].pos = Children.GetHeadPosition();

	if (pos.Stack[0].pos != NULL)
	{
		return(GetNextDescendent(pos));
	}

	return(NULL);
}
Exemplo n.º 2
0
//-----------------------------------------------------------------------------
// Purpose: Begins a depth-first search of the map heirarchy.
// Input  : pos - An iterator 
// Output : CMapClass
//-----------------------------------------------------------------------------
CMapClass *CMapClass::GetFirstDescendent(EnumChildrenPos_t &pos)
{
	pos.nDepth = 0;
	pos.Stack[0].pParent = this;

	if ( m_Children.Count() )
	{
		pos.Stack[0].pos = 0;
		return(GetNextDescendent(pos));
	}
	else
	{
		pos.Stack[0].pos = -1;
		return NULL;
	}
}