From f67d07fbf6f1f11aa559734aeca27dfd0f366362 Mon Sep 17 00:00:00 2001 From: Github Actions Date: Wed, 4 Oct 2023 14:00:38 +0000 Subject: [PATCH] FORMAT-AUTO: automatic format on pull request #39 --- src/Client/Systems/Events/EventsSystems.cpp | 2 +- src/ECS/Systems/Systems.cpp | 92 ++++++++++----------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/Client/Systems/Events/EventsSystems.cpp b/src/Client/Systems/Events/EventsSystems.cpp index 34f2e93b..04c64698 100644 --- a/src/Client/Systems/Events/EventsSystems.cpp +++ b/src/Client/Systems/Events/EventsSystems.cpp @@ -63,7 +63,7 @@ namespace Systems { const Types::Velocity velocity = {-0.7F, 0.0F}; const Types::Missiles missileType = {Types::MissileTypes::CLASSIC}; const Types::Health health = {1}; - const Types::Damage damage = {10}; + const Types::Damage damage = {10}; static void createMissile( std::size_t id, diff --git a/src/ECS/Systems/Systems.cpp b/src/ECS/Systems/Systems.cpp index e10b489e..10c72946 100644 --- a/src/ECS/Systems/Systems.cpp +++ b/src/ECS/Systems/Systems.cpp @@ -99,30 +99,30 @@ namespace Systems { } } - #ifndef NDEBUG - void debugCollisionRect(std::size_t /*unused*/, std::size_t /*unused*/) - { - Registry::components arrCollisionRect = - Registry::getInstance().getComponents(); - Registry::components arrPosition = - Registry::getInstance().getComponents(); - Registry::components arrRectangleShape = - Registry::getInstance().getComponents(); +#ifndef NDEBUG + void debugCollisionRect(std::size_t /*unused*/, std::size_t /*unused*/) + { + Registry::components arrCollisionRect = + Registry::getInstance().getComponents(); + Registry::components arrPosition = + Registry::getInstance().getComponents(); + Registry::components arrRectangleShape = + Registry::getInstance().getComponents(); - std::vector ids = arrCollisionRect.getExistingsId(); + std::vector ids = arrCollisionRect.getExistingsId(); - for (auto &id : ids) { - if (arrPosition.exist(id) && !arrRectangleShape.exist(id)) { - Registry::getInstance() - .getComponents() - .insert( - id, - {arrCollisionRect[id].width, - arrCollisionRect[id].height}); - } + for (auto &id : ids) { + if (arrPosition.exist(id) && !arrRectangleShape.exist(id)) { + Registry::getInstance() + .getComponents() + .insert( + id, + {arrCollisionRect[id].width, + arrCollisionRect[id].height}); } } - #endif + } +#endif void moveEntities(std::size_t /*unused*/, std::size_t /*unused*/) { @@ -140,7 +140,7 @@ namespace Systems { } } } - + static void executeDeathFunction( std::size_t id, Registry::components arrDead) @@ -151,21 +151,21 @@ namespace Systems { Registry::getInstance().removeEntity(id); } } - void deathChecker(std::size_t /*unused*/, std::size_t /*unused*/) - { - Registry::components arrHealth = - Registry::getInstance().getComponents(); - Registry::components arrDead = - Registry::getInstance().getComponents(); + void deathChecker(std::size_t /*unused*/, std::size_t /*unused*/) + { + Registry::components arrHealth = + Registry::getInstance().getComponents(); + Registry::components arrDead = + Registry::getInstance().getComponents(); - std::vector ids = arrHealth.getExistingsId(); - for (auto itIds = ids.begin(); itIds != ids.end(); itIds++) { - if (arrHealth.exist(*itIds) && arrHealth[*itIds].hp <= 0 - && arrDead.exist(*itIds)) { - executeDeathFunction(*itIds, arrDead); - } + std::vector ids = arrHealth.getExistingsId(); + for (auto itIds = ids.begin(); itIds != ids.end(); itIds++) { + if (arrHealth.exist(*itIds) && arrHealth[*itIds].hp <= 0 + && arrDead.exist(*itIds)) { + executeDeathFunction(*itIds, arrDead); } } + } const std::string musicPath = "assets/Audio/Musics/Title.mp3"; const std::string soundPath = "assets/Audio/Sounds/fire.ogg"; @@ -262,18 +262,18 @@ namespace Systems { .removeSystem(systemId); } - #ifndef NDEBUG - std::vector> getECSSystems() - { - return { - windowCollision, - init, - entitiesCollision, - moveEntities, - debugCollisionRect, - deathChecker}; - } - #else +#ifndef NDEBUG + std::vector> getECSSystems() + { + return { + windowCollision, + init, + entitiesCollision, + moveEntities, + debugCollisionRect, + deathChecker}; + } +#else std::vector> getECSSystems() { return { @@ -283,5 +283,5 @@ namespace Systems { moveEntities, deathChecker}; } - #endif +#endif } // namespace Systems