aboutsummaryrefslogtreecommitdiff
path: root/mwe/ecs-homemade/src
diff options
context:
space:
mode:
authorMax-001 <80035972+Max-001@users.noreply.github.com>2024-10-02 16:21:01 +0200
committerMax-001 <80035972+Max-001@users.noreply.github.com>2024-10-02 16:21:01 +0200
commit3e99a6fe36e63a1e14ba62f2a6e5a3827484e4e6 (patch)
treeb548b5815921a6918c4f4b0303cd0208a18fb93d /mwe/ecs-homemade/src
parent7fc607bc74e0be80b1668032348459399c311898 (diff)
DeleteAllComponents created
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) {