Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
APlugin.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "core/Core.hpp"
4#include "plugin/IPlugin.hpp"
5
6namespace Engine {
9class APlugin : public IPlugin {
10 public:
14 explicit APlugin(Core &core);
15
17 virtual void Bind(void) = 0;
18
28 template <CScheduler TScheduler, typename... Systems> decltype(auto) RegisterSystems(Systems... systems);
29
35 template <typename TResource> TResource &RegisterResource(TResource &&resource);
36
40 template <CPlugin... TPlugins> void RequirePlugins();
41
49 template <CScheduler TScheduler, typename... Args> TScheduler &RegisterScheduler(Args &&...args);
50
54 Core &GetCore();
55
56 private:
62 template <CPlugin TPlugin> void RequirePlugin();
63
66};
67} // namespace Engine
68
69#include "plugin/APlugin.ipp"
Core & GetCore()
Get a reference to the core. This can be used to register systems and resources in the Bind method.
Definition APlugin.cpp:6
decltype(auto) RegisterSystems(Systems... systems)
Register systems to a scheduler.
Definition APlugin.ipp:4
APlugin(Core &core)
Constructor for APlugin. It takes a reference to the Core, which is used to register systems and reso...
Definition APlugin.cpp:4
void RequirePlugin()
Add a plugin to the core if it is not already added.
Definition APlugin.ipp:21
TScheduler & RegisterScheduler(Args &&...args)
Register a scheduler in the core.
Definition APlugin.ipp:16
Core & _core
Reference to the core, which is used to register systems and resources in the Bind method.
Definition APlugin.hpp:65
void RequirePlugins()
Add a plugin to the core.
Definition APlugin.ipp:14
virtual void Bind(void)=0
Pure virtual method that must be implemented by derived plugin classes. This method is called when th...
TResource & RegisterResource(TResource &&resource)
Register a resource in the core.
Definition APlugin.ipp:9
The core is the place where all the data of the engine is stored. It contains the registry (entities)...
Definition Core.hpp:33
Interface for plugins that can be added to the engine.
Definition IPlugin.hpp:6
Definition Core.hpp:25
Definition Core.hpp:22
Definition Core.hpp:17