Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
System.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <algorithm>
4#include <entt/entt.hpp>
5#include <functional>
6#include <iostream>
7#include <list>
8#include <memory>
9#include <vector>
10
11#include "CallableFunction.hpp"
12#include "FunctionContainer.hpp"
13#include "Logger.hpp"
14
15namespace Engine {
16class Core;
17
19
21
26 public:
32 template <typename... TSystem> decltype(auto) AddSystems(TSystem... systems);
33
36 const std::list<std::unique_ptr<SystemBase>> &GetSystems();
37
42 std::unique_ptr<SystemBase> DeleteSystem(const FunctionUtils::FunctionID &id);
43
44 private:
49 template <typename TCallable> void AddSystem(TCallable callable);
50};
51
52} // namespace Engine
53
54#include "System.ipp"
The core is the place where all the data of the engine is stored. It contains the registry (entities)...
Definition Core.hpp:33
Container class for managing multiple systems.
Definition System.hpp:25
void AddSystem(TCallable callable)
Add a system to the container.
Definition System.ipp:10
decltype(auto) AddSystems(TSystem... systems)
Adds systems to the container.
Definition System.ipp:5
std::unique_ptr< SystemBase > DeleteSystem(const FunctionUtils::FunctionID &id)
Deletes a system from the container by its FunctionID.
Definition System.cpp:6
const std::list< std::unique_ptr< SystemBase > > & GetSystems()
Gets the list of systems in the container.
Definition System.cpp:4
Base class for all functions contained in a FunctionContainer.
Definition BaseFunction.hpp:10
Abstract class that holds a callable object, to be later stored in a container.
Definition CallableFunction.hpp:13
Container for functions, allowing for dynamic storage and invocation.
Definition FunctionContainer.hpp:14
Definition Core.hpp:17
FunctionUtils::BaseFunction< void, Core & > SystemBase
Definition System.hpp:18
FunctionUtils::CallableFunction< TCallable, void, Core & > System
Definition System.hpp:20
std::size_t FunctionID
FunctionID class to represent a unique identifier for functions.
Definition FunctionID.hpp:9