diff --git a/core/include/cubos/core/ecs/system/system.hpp b/core/include/cubos/core/ecs/system/system.hpp index 7b8ccd8220..010b56ef78 100644 --- a/core/include/cubos/core/ecs/system/system.hpp +++ b/core/include/cubos/core/ecs/system/system.hpp @@ -43,7 +43,7 @@ namespace cubos::core::ecs /// A system may be invalid, if, for example, it both reads and writes the same resource. /// /// @return Whether the system is valid. - bool valid() const; + static bool valid(); /// @brief Checks if this system is compatible with another system. /// diff --git a/core/src/cubos/core/ecs/system/system.cpp b/core/src/cubos/core/ecs/system/system.cpp index bf262d1b6b..a2ae369fed 100644 --- a/core/src/cubos/core/ecs/system/system.cpp +++ b/core/src/cubos/core/ecs/system/system.cpp @@ -2,21 +2,8 @@ using namespace cubos::core::ecs; -bool SystemInfo::valid() const +bool SystemInfo::valid() { - if (this->usesWorld) - { - return !this->usesCommands && this->resourcesRead.empty() && this->resourcesWritten.empty(); - } - - for (const auto& rsc : this->resourcesRead) - { - if (this->resourcesWritten.contains(rsc)) - { - return false; - } - } - return true; } diff --git a/core/tests/ecs/system.cpp b/core/tests/ecs/system.cpp index dffb36e015..319711c285 100644 --- a/core/tests/ecs/system.cpp +++ b/core/tests/ecs/system.cpp @@ -54,35 +54,6 @@ TEST_CASE("ecs::SystemInfo") CHECK(infoA.valid()); } - SUBCASE("A is invalid") - { - SUBCASE("A reads and writes to the same resource") - { - infoA.resourcesRead.insert(typeid(int)); - infoA.resourcesWritten.insert(typeid(int)); - } - - SUBCASE("A uses the world directly and reads a resource") - { - infoA.usesWorld = true; - infoA.resourcesRead.insert(typeid(int)); - } - - SUBCASE("A uses the world directly and writes a resource") - { - infoA.usesWorld = true; - infoA.resourcesWritten.insert(typeid(int)); - } - - SUBCASE("A uses the world directly and uses commands") - { - infoA.usesWorld = true; - infoA.usesCommands = true; - } - - CHECK_FALSE(infoA.valid()); - } - SUBCASE("A and B are compatible") { SUBCASE("both do nothing")