galaxy 1.0.0
Real-Time C++23 Game Programming Framework. Built on data-driven design principles and agile software engineering.
Loading...
Searching...
No Matches
System.hpp
Go to the documentation of this file.
1
7
8#ifndef GALAXY_SYSTEMS_SYSTEM_HPP_
9#define GALAXY_SYSTEMS_SYSTEM_HPP_
10
11#include <concepts>
12#include <string>
13
15
16namespace galaxy
17{
18 class Scene;
19
23 class System
24 {
25 public:
29 System(System&&) noexcept;
30
34 System& operator=(System&&) noexcept;
35
39 virtual ~System() noexcept;
40
47 virtual void update(EntityManager& em, Scene* scene) = 0;
48
54 [[nodiscard]]
55 const std::string& id() const noexcept;
56
57 protected:
63 System(const std::string& id) noexcept;
64
65 private:
69 System() = delete;
70
74 System& operator=(const System&) = delete;
78 System(const System&) = delete;
79
80 protected:
84 std::string m_id;
85 };
86
87 namespace meta
88 {
94 template<typename Type>
95 concept is_system = std::derived_from<Type, System>;
96 } // namespace meta
97} // namespace galaxy
98
99#endif
Class for making creating and managing entities easier.
Represents a scene in a game.
Definition Scene.hpp:27
Represents a system that operates on sets of components.
Definition System.hpp:24
std::string m_id
Debug id.
Definition System.hpp:84
System()=delete
Constructor.
const std::string & id() const noexcept
Get identifier.
Definition System.cpp:36
virtual void update(EntityManager &em, Scene *scene)=0
Abstract implementation for updating the system. Use the manager to retreive your components.
virtual ~System() noexcept
Destructor.
Definition System.cpp:32
System & operator=(System &&) noexcept
Move assignment operator.
Definition System.cpp:22
Concept to ensure a system is actually derived from a System.
Definition System.hpp:95
Application.hpp galaxy.
STL namespace.