mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-03 10:26:29 +00:00
Merge branch 'develop' into parser
This commit is contained in:
@@ -146,7 +146,7 @@ namespace WAL
|
||||
{
|
||||
const std::type_index &type = typeid(T);
|
||||
if (this->hasComponent(type))
|
||||
throw DuplicateError("A component of the type \"" + std::string(type.name()) + "\" already exists.");
|
||||
throw DuplicateError("A component of the type \"" + std::string(type.name()) + "\" already exists on " + this->_name + ".");
|
||||
this->_components[type] = std::make_unique<T>(*this, TypeHolder<TNested>()..., std::forward<Types>(params)...);
|
||||
if (this->_notifyScene)
|
||||
this->_componentAdded(type);
|
||||
|
||||
@@ -44,7 +44,8 @@ namespace WAL
|
||||
virtual void onFixedUpdate(ViewEntity<Dependencies...> &entity) {}
|
||||
|
||||
//! @brief A method called after all entities that this system manage has been updated.
|
||||
virtual void onSelfUpdate() {}
|
||||
//! @param dtime The delta time.
|
||||
virtual void onSelfUpdate(std::chrono::nanoseconds dtime) {}
|
||||
|
||||
|
||||
//! @brief Update the whole system (every entities that this system is responsible can be updated.
|
||||
@@ -53,7 +54,7 @@ namespace WAL
|
||||
{
|
||||
for (auto &entity : this->getView())
|
||||
this->onUpdate(entity, dtime);
|
||||
this->onSelfUpdate();
|
||||
this->onSelfUpdate(dtime);
|
||||
}
|
||||
|
||||
//! @brief An alternative of update that is called every 8ms (120 times per seconds). If the system slow down, it will try to catch up.
|
||||
|
||||
Reference in New Issue
Block a user