From 75593e1b13c30be51f7cfd5070564dcf4bdaef3e Mon Sep 17 00:00:00 2001 From: Xavier Mitault Date: Sat, 23 Sep 2023 22:19:08 +0200 Subject: [PATCH] CICD: Fix missing virtual and overide --- src/Client/Systems/Managers/GraphicManager.cpp | 2 +- src/Client/Systems/Managers/GraphicManager.hpp | 8 ++++---- src/Client/Systems/Managers/SystemEventsManager.cpp | 2 +- src/Client/Systems/Managers/SystemEventsManager.hpp | 12 +++++++++--- src/ECS/Systems/Managers/ASystemManager.hpp | 13 ++++++++++--- src/ECS/Systems/Managers/GameManager.cpp | 2 +- src/ECS/Systems/Managers/GameManager.hpp | 12 +++++++++--- 7 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/Client/Systems/Managers/GraphicManager.cpp b/src/Client/Systems/Managers/GraphicManager.cpp index 36a24977..a9c9ca0f 100644 --- a/src/Client/Systems/Managers/GraphicManager.cpp +++ b/src/Client/Systems/Managers/GraphicManager.cpp @@ -24,7 +24,7 @@ namespace Systems { InitWindow(screenWidth, screenHeight, "Poc ECS"); SetTargetFPS(frameRate); - addSystem(GraphicSystems::pixelRenderer); + ASystemManager::addSystem(GraphicSystems::pixelRenderer); } GraphicManager::~GraphicManager() diff --git a/src/Client/Systems/Managers/GraphicManager.hpp b/src/Client/Systems/Managers/GraphicManager.hpp index a64a051f..7be0caf8 100644 --- a/src/Client/Systems/Managers/GraphicManager.hpp +++ b/src/Client/Systems/Managers/GraphicManager.hpp @@ -12,10 +12,11 @@ namespace Systems { class GraphicManager : public ASystemManager { public: + ~GraphicManager() override; static auto getInstance() -> GraphicManager &; - void updateSystems(); - void addSystem(std::function /*sys*/); - void removeSystem(std::size_t /*id*/); + void updateSystems() override; + void addSystem(std::function /*sys*/) override; + void removeSystem(std::size_t /*id*/) override; GraphicManager(GraphicManager const &) = delete; GraphicManager(GraphicManager const &&) = delete; @@ -24,7 +25,6 @@ namespace Systems { private: GraphicManager(); - ~GraphicManager(); // NOLINTBEGIN(cppcoreguidelines-avoid-non-const-global-variables) static GraphicManager _instance; // NOLINTEND(cppcoreguidelines-avoid-non-const-global-variables) diff --git a/src/Client/Systems/Managers/SystemEventsManager.cpp b/src/Client/Systems/Managers/SystemEventsManager.cpp index 03062d90..633f4d42 100644 --- a/src/Client/Systems/Managers/SystemEventsManager.cpp +++ b/src/Client/Systems/Managers/SystemEventsManager.cpp @@ -17,7 +17,7 @@ namespace Systems { SystemEventsManager::SystemEventsManager() { - addSystem(EventsSystems::playerMovement); + ASystemManager::addSystem(EventsSystems::playerMovement); } auto SystemEventsManager::getInstance() -> SystemEventsManager & diff --git a/src/Client/Systems/Managers/SystemEventsManager.hpp b/src/Client/Systems/Managers/SystemEventsManager.hpp index 66c05fbb..eddfb8fd 100644 --- a/src/Client/Systems/Managers/SystemEventsManager.hpp +++ b/src/Client/Systems/Managers/SystemEventsManager.hpp @@ -12,10 +12,16 @@ namespace Systems { class SystemEventsManager : public ASystemManager { public: + ~SystemEventsManager() override = default; static auto getInstance() -> SystemEventsManager &; - void updateSystems(); - void addSystem(std::function /*sys*/); - void removeSystem(std::size_t /*id*/); + void updateSystems() override; + void addSystem(std::function /*sys*/) override; + void removeSystem(std::size_t /*id*/) override; + + SystemEventsManager(SystemEventsManager const &) = delete; + SystemEventsManager(SystemEventsManager const &&) = delete; + void operator=(SystemEventsManager const &) = delete; + void operator=(SystemEventsManager const &&) = delete; private: SystemEventsManager(); diff --git a/src/ECS/Systems/Managers/ASystemManager.hpp b/src/ECS/Systems/Managers/ASystemManager.hpp index f15f090d..6450f5c2 100644 --- a/src/ECS/Systems/Managers/ASystemManager.hpp +++ b/src/ECS/Systems/Managers/ASystemManager.hpp @@ -14,14 +14,21 @@ namespace Systems { class ASystemManager { + public: + virtual ~ASystemManager() = default; + ASystemManager(const ASystemManager &) = delete; + auto operator=(const ASystemManager &) -> ASystemManager & = delete; + ASystemManager(ASystemManager &&) = delete; + auto operator=(ASystemManager &&) -> ASystemManager & = delete; + protected: ASystemManager() = default; - void updateSystems(); + virtual void updateSystems(); - void addSystem(std::function /*sys*/); + virtual void addSystem(std::function /*sys*/); - void removeSystem(std::size_t /*id*/); + virtual void removeSystem(std::size_t /*id*/); auto getSystems() -> std::list> &; diff --git a/src/ECS/Systems/Managers/GameManager.cpp b/src/ECS/Systems/Managers/GameManager.cpp index 4086b106..89cc44fd 100644 --- a/src/ECS/Systems/Managers/GameManager.cpp +++ b/src/ECS/Systems/Managers/GameManager.cpp @@ -15,7 +15,7 @@ namespace Systems { GameManager::GameManager() { - addSystem(Systems::collision); + ASystemManager::addSystem(Systems::collision); } auto GameManager::getInstance() -> GameManager & diff --git a/src/ECS/Systems/Managers/GameManager.hpp b/src/ECS/Systems/Managers/GameManager.hpp index 8afc9af7..adbb4a13 100644 --- a/src/ECS/Systems/Managers/GameManager.hpp +++ b/src/ECS/Systems/Managers/GameManager.hpp @@ -12,10 +12,16 @@ namespace Systems { class GameManager : public ASystemManager { public: + ~GameManager() override = default; static auto getInstance() -> GameManager &; - void updateSystems(); - void addSystem(std::function /*sys*/); - void removeSystem(std::size_t /*id*/); + void updateSystems() override; + void addSystem(std::function /*sys*/) override; + void removeSystem(std::size_t /*id*/) override; + + GameManager(GameManager const &) = delete; + GameManager(GameManager const &&) = delete; + void operator=(GameManager const &) = delete; + void operator=(GameManager const &&) = delete; private: GameManager();