How would I implement a For each... -style condition in my object? SVN does not have examples on this, such as Array::For each element.
Is it just a matter of (pseudoish code):
long ExtObject::cForEachThing(LPVAL params)
{
if(things.size() == 0)
return false; //no things, no for each
currentThing++;
//reset counter if at end
if(currentThing == things.end());
currentThing = things.begin();
return true;
}
[/code:vo7952n6]
and then an expression to retrieve data from currentThing. Doesn't this just get called once per frame, when I want to go through each object on every frame?