r-type  0.0.0
R-Type main
Loading...
Searching...
No Matches
ISystems.hpp
Go to the documentation of this file.
1///
2/// @file ISystems.hpp
3/// @brief This file contains the interface for systems
4/// @namespace ecs
5///
6
7#pragma once
8
9#include "ECS/Registry.hpp"
10
11namespace ecs
12{
13
14 ///
15 /// @interface ISystem
16 /// @brief Interface class for system
17 /// @namespace ecs
18 ///
19 class ISystem
20 {
21 public:
22 virtual ~ISystem() = default;
23 virtual void update(Registry &registry, float dt) = 0;
24 virtual bool isEnable() = 0;
25 virtual void setEnable(bool enable) = 0;
26 };
27
28 ///
29 /// @class ASystem
30 /// @brief Abstract class for system
31 /// @namespace ecs
32 ///
33 class ASystem : public ISystem
34 {
35 public:
36 bool isEnable() override { return m_isEnable; }
37 void setEnable(const bool enable) override { m_isEnable = enable; }
38
39 private:
40 bool m_isEnable = true;
41 };
42
43} // namespace ecs
This file contains the Registry class declaration.
Abstract class for system.
Definition ISystems.hpp:34
bool isEnable() override
Definition ISystems.hpp:36
bool m_isEnable
Definition ISystems.hpp:40
void setEnable(const bool enable) override
Definition ISystems.hpp:37
Interface class for system.
Definition ISystems.hpp:20
virtual ~ISystem()=default
virtual void update(Registry &registry, float dt)=0
virtual void setEnable(bool enable)=0
virtual bool isEnable()=0
Class for managing entities and their components.
Definition Registry.hpp:25