CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
SystemManager.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "Forward.hpp"
11
12#include "System.hpp"
13
15
18
19namespace CeresEngine {
23 public:
26
27 private:
30
34
35 public:
39 explicit SystemManager(EntityManager& entityManager);
40
41 SystemManager(const SystemManager&) = delete;
42 SystemManager& operator=(const SystemManager&) = delete;
43
46
47 public:
53 template<CSystemImplementation S, typename... Args> S& add(Args&&... args);
54
57 template<CSystem S> void remove();
58
62 template<CSystem S> [[nodiscard]] S& get();
63
68 template<CSystem S> [[nodiscard]] bool has() noexcept;
69
70 public:
75 void update(double time);
76
83 template<CSystem S> bool update(double time);
84
85 private:
87 void sort() noexcept;
88 };
89
90} // namespace CeresEngine
91
92#include "SystemManager.inl"
#define CE_SCRIPT_EXPORT(...)
The CE_SCRIPT_EXPORT macro marks a class or method as exportable and available in scripting environme...
Definition Macros.hpp:247
Definition EntityManager.hpp:49
The system manager is responsible for keeping track and dispatching updates to all attached systems.
Definition SystemManager.hpp:22
EntityManager & mEntityManager
The entity manager to be used by systems.
Definition SystemManager.hpp:25
Vector< UPtr< AbstractSystem > > mSystems
A vector of all attached systems. Sorted by their ´SystemID`.
Definition SystemManager.hpp:29
Vector< AbstractSystem * > mSortedSystems
A vector of all attached systems.
Definition SystemManager.hpp:33
Definition System.hpp:219
Definition System.hpp:222
Definition Application.hpp:19
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25