mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-06-09 20:25:31 +00:00
alalalallalalllala
This commit is contained in:
@@ -38,7 +38,7 @@ namespace WAL
|
||||
//! @return True if all dependencies are met, false otherwise.
|
||||
static bool _hasDependencies(const Entity &entity, const System &system);
|
||||
public:
|
||||
//! @brief The scene manager that allow multiple scene to work together.
|
||||
//! @brief The scene that contains entities.
|
||||
Scene scene;
|
||||
//! @brief The time between each fixed update.
|
||||
static std::chrono::nanoseconds timestep;
|
||||
@@ -46,7 +46,7 @@ namespace WAL
|
||||
//! @brief Create a new system in place.
|
||||
//! @return The wal instance used to call this function is returned. This allow method chaining.
|
||||
template<typename T, class ...Types>
|
||||
Wal &addSystem(Types ...params)
|
||||
Wal &addSystem(Types &&...params)
|
||||
{
|
||||
const std::type_info &type = typeid(T);
|
||||
auto existing = std::find_if(this->_systems.begin(), this->_systems.end(), [&type] (auto &sys) {
|
||||
@@ -54,7 +54,7 @@ namespace WAL
|
||||
});
|
||||
if (existing != this->_systems.end())
|
||||
throw DuplicateError("A system of the type \"" + std::string(type.name()) + "\" already exists.");
|
||||
this->_systems.push_back(std::make_unique<T>(params...));
|
||||
this->_systems.push_back(std::make_unique<T>(std::forward<Types>(params)...));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user