#include <qafEnvironment.h>
Environment's list of active game objects.
Instances of this class are returned by Environment::makeObjIterator().
Note that there is no guarantee as to the order objects are returned by the iterator.
If you need to iterate over a specific class of object, use the template form:
ObjIterator<YourClass> i = Environment::makeObjIterator<YourClass>();
while ( i.hasNext() ) {
YourClass * obj = i.next();
// Do something with the object...
}
ObjIterators are invalidated at the end of a frame cycle; you must get a new ObjIterator every frame. ObjIterator along with the object manipulation methods (Environment::addGameObj(), Environment::removeGameObj(), Environment::moveGameObj()) and room management (Environment::loadRoom(), Environment::unloadRoom()), since those are buffered.
Public Member Functions | |
| bool | hasNext () |
| |
| T * | next () |
| Retrieves the next object in the list and advances the pointer to the next object. | |
| int | getCount () |
| |
Friends | |
| class | Environment |
| T* qaf::ObjIterator< T >::next | ( | ) | [inline] |
Retrieves the next object in the list and advances the pointer to the next object.
If the end of the object list has been reached, returns NULL.
1.5.1-p1