Skip to content

Commit

Permalink
CICD: Fix missing virtual and overide
Browse files Browse the repository at this point in the history
  • Loading branch information
Saverio976 committed Sep 23, 2023
1 parent 6d8383a commit 75593e1
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Client/Systems/Managers/GraphicManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Systems {
InitWindow(screenWidth, screenHeight, "Poc ECS");
SetTargetFPS(frameRate);

addSystem(GraphicSystems::pixelRenderer);
ASystemManager::addSystem(GraphicSystems::pixelRenderer);
}

GraphicManager::~GraphicManager()
Expand Down
8 changes: 4 additions & 4 deletions src/Client/Systems/Managers/GraphicManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@
namespace Systems {
class GraphicManager : public ASystemManager {
public:
~GraphicManager() override;
static auto getInstance() -> GraphicManager &;
void updateSystems();
void addSystem(std::function<void(std::size_t)> /*sys*/);
void removeSystem(std::size_t /*id*/);
void updateSystems() override;
void addSystem(std::function<void(std::size_t)> /*sys*/) override;
void removeSystem(std::size_t /*id*/) override;

GraphicManager(GraphicManager const &) = delete;
GraphicManager(GraphicManager const &&) = delete;
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Client/Systems/Managers/SystemEventsManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Systems {

SystemEventsManager::SystemEventsManager()
{
addSystem(EventsSystems::playerMovement);
ASystemManager::addSystem(EventsSystems::playerMovement);
}

auto SystemEventsManager::getInstance() -> SystemEventsManager &
Expand Down
12 changes: 9 additions & 3 deletions src/Client/Systems/Managers/SystemEventsManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
namespace Systems {
class SystemEventsManager : public ASystemManager {
public:
~SystemEventsManager() override = default;
static auto getInstance() -> SystemEventsManager &;
void updateSystems();
void addSystem(std::function<void(std::size_t)> /*sys*/);
void removeSystem(std::size_t /*id*/);
void updateSystems() override;
void addSystem(std::function<void(std::size_t)> /*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();
Expand Down
13 changes: 10 additions & 3 deletions src/ECS/Systems/Managers/ASystemManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<void(std::size_t)> /*sys*/);
virtual void addSystem(std::function<void(std::size_t)> /*sys*/);

void removeSystem(std::size_t /*id*/);
virtual void removeSystem(std::size_t /*id*/);

auto getSystems() -> std::list<std::function<void(std::size_t)>> &;

Expand Down
2 changes: 1 addition & 1 deletion src/ECS/Systems/Managers/GameManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ namespace Systems {

GameManager::GameManager()
{
addSystem(Systems::collision);
ASystemManager::addSystem(Systems::collision);
}

auto GameManager::getInstance() -> GameManager &
Expand Down
12 changes: 9 additions & 3 deletions src/ECS/Systems/Managers/GameManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@
namespace Systems {
class GameManager : public ASystemManager {
public:
~GameManager() override = default;
static auto getInstance() -> GameManager &;
void updateSystems();
void addSystem(std::function<void(std::size_t)> /*sys*/);
void removeSystem(std::size_t /*id*/);
void updateSystems() override;
void addSystem(std::function<void(std::size_t)> /*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();
Expand Down

0 comments on commit 75593e1

Please sign in to comment.