![]() |
Copperfield Engine 0.1
C++ Game Engine
|
Helper to iterate several component lists simultaneously. More...
#include <lists_iterator.hpp>
Public Member Functions | |
ComponentIterator (T &main, Types &... list) | |
Constructor. More... | |
bool | next () |
Iterates all lists until an entity containing all components is found. More... | |
auto | get () |
Retrieve the components of the last entity found using next. More... | |
Entity | getEntity () |
retrieves the entity being currently iterated More... | |
void | reset () |
Resets the internal state, so that you can iterate the lists again. | |
Helper to iterate several component lists simultaneously.
T | Main list to iterate; it should be a list that contains fewer components. |
Types | Rest of the lists. |
|
inline |
Constructor.
main | Should be a list that contains fewer components. |
...list | Rest of the lists. |
|
inline |
Retrieve the components of the last entity found using next.
|
inline |
retrieves the entity being currently iterated
make sure you don't delete an entity during iteration it will break the internal iterator and probably crash the program
you can store the entities you want to delete in an array and delete them after the loop has finished
|
inline |
Iterates all lists until an entity containing all components is found.