I'm having trouble with managing entities; I'm always getting "vector iterator not incrementable ".
(below is some pseudo code)
class Game;
class Entity {
public:
void update(sf::Time dt, Game& game) {
game.addEntity(); //ERROR IS HERE
}
};
class Game {
public:
Game() : mEntities() {
addEntity();
}
void addEntity(Entity* e) {
mEntities.push_back(e);
}
vector<Entity*> mEntities;
};
When I try calling 'addEntity()' from a different class I get an error.