aboutsummaryrefslogtreecommitdiff
path: root/mwe/ecs-homemade/src
diff options
context:
space:
mode:
Diffstat (limited to 'mwe/ecs-homemade/src')
-rw-r--r--mwe/ecs-homemade/src/ComponentManager.cpp8
-rw-r--r--mwe/ecs-homemade/src/main.cpp2
2 files changed, 10 insertions, 0 deletions
diff --git a/mwe/ecs-homemade/src/ComponentManager.cpp b/mwe/ecs-homemade/src/ComponentManager.cpp
index 287da38..cca84bc 100644
--- a/mwe/ecs-homemade/src/ComponentManager.cpp
+++ b/mwe/ecs-homemade/src/ComponentManager.cpp
@@ -7,3 +7,11 @@ ComponentManager& ComponentManager::GetInstance() {
}
ComponentManager::ComponentManager() {}
+
+void ComponentManager::DeleteAllComponentsOfId(std::uint32_t id) {
+
+}
+
+void ComponentManager::DeleteAllComponents() {
+ mComponents.clear();
+}
diff --git a/mwe/ecs-homemade/src/main.cpp b/mwe/ecs-homemade/src/main.cpp
index 9e230e5..df229a2 100644
--- a/mwe/ecs-homemade/src/main.cpp
+++ b/mwe/ecs-homemade/src/main.cpp
@@ -99,6 +99,8 @@ int main() {
}
std::cout << std::endl;
+ ComponentManager::GetInstance().DeleteAllComponents();
+
std::cout << "Finding all rigidbodies of all entities for the second time (after changing mMass to -1)" << std::endl;
std::vector<std::pair<std::reference_wrapper<Rigidbody>, std::uint32_t>> rigidBodies2 = ComponentManager::GetInstance().GetComponentsByType<Rigidbody>();
for(auto& [rigidbody2, id2] : rigidBodies2) {