alalalallalalllala

This commit is contained in:
Zoe Roux
2021-05-27 16:37:22 +02:00
parent d69a4f8ee2
commit a26725f5a5
22 changed files with 467 additions and 133 deletions

View File

@@ -75,11 +75,11 @@ namespace WAL
//! @throw DuplicateError is thrown if a component with the same type already exist.
//! @return This entity is returned
template<typename T, typename ...Types>
Entity &addComponent(Types ...params)
Entity &addComponent(Types &&...params)
{
if (this->hasComponent<T>())
throw DuplicateError("A component of the type \"" + std::string(typeid(T).name()) + "\" already exists.");
this->_components.push_back(std::make_unique<T>(*this, params...));
this->_components.push_back(std::make_unique<T>(*this, std::forward<Types>(params)...));
return *this;
}