Remove shared pointer, ODR of componentType variable

This commit is contained in:
David Markowitz
2023-06-09 01:22:45 -07:00
parent ec00f5fd9d
commit 62aa863997
49 changed files with 60 additions and 75 deletions

View File

@@ -48,7 +48,7 @@ namespace CppScripts {
* Entities are composed of components which define their behavior.
*/
using ComponentPtr = std::shared_ptr<Component>;
using ComponentPtr = std::unique_ptr<Component>;
class Entity {
public:
@@ -278,15 +278,6 @@ public:
template<typename Cmpt>
Cmpt* GetComponent() const;
/**
* @brief Get an owning reference to a component.
*
* @tparam Cmpt The component to get a shared reference of
* @return std::shared_ptr<Cmpt> The owning shared pointer
*/
template<typename Cmpt>
std::shared_ptr<Cmpt> GetSharedComponent() const;
/**
* @brief Adds a component to this Entity.
*