mirror of
https://github.com/zoriya/Bomberman.git
synced 2025-12-21 05:45:10 +00:00
Adding a onStart onStop
This commit is contained in:
@@ -62,6 +62,8 @@ namespace WAL
|
||||
this->_entities.remove_if([this](auto &entity) {
|
||||
if (!entity.shouldDelete())
|
||||
return false;
|
||||
for (auto &cmp : entity._components)
|
||||
cmp.second->onStop();
|
||||
this->_entityRemoved(entity);
|
||||
return true;
|
||||
});
|
||||
@@ -74,7 +76,14 @@ namespace WAL
|
||||
view->emplace_back(entity);
|
||||
}
|
||||
entity._notifyScene = true;
|
||||
for (auto &cmp : entity._components)
|
||||
cmp.second->onStart();
|
||||
}
|
||||
this->_entities.splice(this->_entities.end(), this->_newEntities);
|
||||
}
|
||||
|
||||
int Scene::getID() const
|
||||
{
|
||||
return this->_id;
|
||||
}
|
||||
} // namespace WAL
|
||||
Reference in New Issue
Block a user