❖
Monad Engine
da02fba2
>
Undercity Codex
_
Loading...
Searching...
No Matches
Component.cpp
Go to the documentation of this file.
1
#include "scene/Component.h"
2
3
namespace
eng
4
{
5
size_t
Component::nextId = 1;
6
7
void
Component::LoadProperties
(
const
nlohmann::json& json)
8
{
9
}
10
11
void
Component::Init
()
12
{
13
}
14
15
GameObject
*
Component::GetOwner
()
16
{
17
return
m_owner
;
18
}
19
20
ComponentFactory
&
ComponentFactory::GetInstance
()
21
{
22
static
ComponentFactory
instance;
23
return
instance;
24
}
25
26
Component
*
ComponentFactory::CreateComponent
(
const
std::string& name)
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
}
eng::ComponentFactory
Definition
Component.h:59
eng::ComponentFactory::GetInstance
static ComponentFactory & GetInstance()
Definition
Component.cpp:20
eng::ComponentFactory::CreateComponent
Component * CreateComponent(const std::string &name)
Definition
Component.cpp:26
eng::Component
Definition
Component.h:15
eng::Component::Init
virtual void Init()
Definition
Component.cpp:11
eng::Component::GetOwner
GameObject * GetOwner()
Definition
Component.cpp:15
eng::Component::LoadProperties
virtual void LoadProperties(const nlohmann::json &json)
Definition
Component.cpp:7
eng::Component::m_owner
GameObject * m_owner
Definition
Component.h:33
eng::GameObject
Definition
GameObject.h:15
eng
Definition
Application.cpp:4
docs
GD-Engine-lesson-5-2
engine
source
scene
Component.cpp
Generated by
1.9.8