Monad Engine da02fba2
> Undercity Codex_
Loading...
Searching...
No Matches
Component.cpp
Go to the documentation of this file.
1#include "scene/Component.h"
2
3namespace eng
4{
5 size_t Component::nextId = 1;
6
7 void Component::LoadProperties(const nlohmann::json& json)
8 {
9 }
10
12 {
13 }
14
16 {
17 return m_owner;
18 }
19
21 {
22 static ComponentFactory instance;
23 return instance;
24 }
25
27 {
28 auto it = m_creators.find(name);
29 if (it != m_creators.end())
30 {
31 return it->second->CreateComponent();
32 }
33
34 return nullptr;
35 }
36}
static ComponentFactory & GetInstance()
Definition Component.cpp:20
Component * CreateComponent(const std::string &name)
Definition Component.cpp:26
virtual void Init()
Definition Component.cpp:11
GameObject * GetOwner()
Definition Component.cpp:15
virtual void LoadProperties(const nlohmann::json &json)
Definition Component.cpp:7
GameObject * m_owner
Definition Component.h:33