SpiecsEngine
 
Loading...
Searching...
No Matches
SystemManager.cpp
Go to the documentation of this file.
1/**
2* @file SystemManager.cpp.
3* @brief The System Class and SystemManager Class Implementation.
4* @author Spices.
5*/
6
7#include "Pchheader.h"
9#include "Core/Event/Event.h"
10
11namespace Spices {
12
13 /**
14 * @brief Defines the static SystemManager variable.
15 */
17
18 /**
19 * @brief Defines the static System Map variable.
20 */
21 scl::linked_unordered_map<std::string, std::shared_ptr<System>> SystemManager::m_Identities;
22
24 {
26
27 m_SystemManager = nullptr;
28 }
29
31 {
33
34 /**
35 * @brief Set Golbal EventCallBack
36 */
38 }
39
41 {
43
44 return *m_SystemManager;
45 }
46
48 {
50
51 m_Identities.for_each([&](auto& k, auto& v) {
52 v->OnSystemUpdate(ts);
53 return false;
54 });
55 }
56
58 {
59 m_Identities.for_each([&](auto& k, auto& v) {
60 v->OnEvent(event);
61 return false;
62 });
63 }
64}
#define BIND_EVENT_FN(x)
Bind Event.
Definition Event.h:88
#define SPICES_PROFILE_ZONE
static void SetEventCallbackFn(const EventCallbackFn &callback)
Set Global Root Event Function Pointer.
Definition Event.cpp:24
This Class is the basic Event Class. Inherit from it and create specific event class.
Definition Event.h:96
void OnEvent(Event &event)
The root event function pointer.
SystemManager()
Constructor Function.
static void Run(TimeStep &ts)
Update all system that pushed to this manager.
static SystemManager & Get()
Get Static SystemManager.
static std::unique_ptr< SystemManager > m_SystemManager
Static SystemManager variable.
virtual ~SystemManager()
Destructor Function.
static scl::linked_unordered_map< std::string, std::shared_ptr< System > > m_Identities
Static System Map.
SystemManager Class. This class defines the behave of SystemManager.
System Class. This class defines the basic behaves of System. When we create an new System,...
This Class handles our engine time step during frames. Global Unique.
Definition TimeStep.h:22
The container combines hashmap and list together. Used in the case that we want iter a hashmap in ord...