diff --git a/src/poc/src/Registry.hpp b/src/poc/src/Registry.hpp index 1d8c39ea..5478b9dd 100644 --- a/src/poc/src/Registry.hpp +++ b/src/poc/src/Registry.hpp @@ -8,13 +8,13 @@ class Registry { public: template - using array = std::shared_ptr>; + using array = SparseArray &; template array registerComponent() { if (_data.find(typeid(Component)) == _data.end()) { - _data[typeid(Component)] = std::make_shared>(); + _data[typeid(Component)] = SparseArray(); } return castReturn(); }; diff --git a/src/poc/src/main.cpp b/src/poc/src/main.cpp index ceaa551b..b65e7a3b 100644 --- a/src/poc/src/main.cpp +++ b/src/poc/src/main.cpp @@ -4,16 +4,16 @@ int main() { Registry registry; - Registry::array arrInt = registry.registerComponent(); - arrInt->add(4); - arrInt->add(69); - Registry::array arrFloat = registry.registerComponent(); - arrFloat->add(69.69); - Registry::array scdContainer = registry.getComponents(); - for (auto begin = arrInt->begin(); begin != arrInt->end(); begin++) { + Registry::array &arrInt = registry.registerComponent(); + arrInt.add(4); + arrInt.add(69); + Registry::array &arrFloat = registry.registerComponent(); + arrFloat.add(69.69); + Registry::array &scdContainer = registry.getComponents(); + for (auto begin = arrInt.begin(); begin != arrInt.end(); begin++) { std::cout << *begin << std::endl; } - for (auto begin = scdContainer->begin(); begin != scdContainer->end(); begin++) { + for (auto begin = scdContainer.begin(); begin != scdContainer.end(); begin++) { std::cout << *begin << std::endl; } return 0;