Recently I have stumbled across multiple places in the SDK where the following code (or something similar) is used:
What exactly is a unit node, and how is it different from a UnitTypes or CvUnit* unit instance? I did some research, and found CvSelectionGroup::headUnitNode() and CvPlot::headUnitNode(). Could this be a way to loop through all units on a specific plot or in a specific group?
Code:
CLLNode<IDInfo>* pUnitNode;
CvUnit* pLoopUnit;
pUnitNode = headUnitNode();
while (pUnitNode != NULL)
{
pLoopUnit = ::getUnit(pUnitNode->m_data);
pUnitNode = nextUnitNode(pUnitNode);
...
}
What exactly is a unit node, and how is it different from a UnitTypes or CvUnit* unit instance? I did some research, and found CvSelectionGroup::headUnitNode() and CvPlot::headUnitNode(). Could this be a way to loop through all units on a specific plot or in a specific group?