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{
21 class System
22 {
23 public:
27 System(System&&) noexcept;
28
32 System& operator=(System&&) noexcept;
33
37 virtual ~System() noexcept;
38
44 virtual void update(Registry& registry) = 0;
45
51 [[nodiscard]]
52 const std::string& id() const noexcept;
53
54 protected:
60 System(const std::string& id) noexcept;
61
62 private:
66 System() = delete;
67
71 System& operator=(const System&) = delete;
75 System(const System&) = delete;
76
77 protected:
81 std::string m_id;
82 };
83
84 namespace meta
85 {
91 template<typename Type>
92 concept is_system = std::derived_from<Type, System>;
93 } // namespace meta
94} // namespace galaxy
95
96#endif
Wrapper around entt::registry to expand functionality.
Definition Registry.hpp:19
Represents a system that operates on sets of components.
Definition System.hpp:22
std::string m_id
Debug id.
Definition System.hpp:81
System()=delete
Constructor.
const std::string & id() const noexcept
Get identifier.
Definition System.cpp:36
virtual void update(Registry &registry)=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:92
Animated.cpp galaxy.
Definition Animated.cpp:16
STL namespace.