Adding a onStart onStop

This commit is contained in:
Zoe Roux
2021-06-09 16:00:06 +02:00
parent c544a83ee8
commit c94237dedc
13 changed files with 79 additions and 38 deletions

View File

@@ -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