CSEngine
Loading...
Searching...
No Matches
ReflectionObject.h
1#pragma once
2
3#include <string>
4#include <utility>
5#include "../../Manager/EngineCore.h"
6#include "../../Manager/ReflectionMgr.h"
7
8namespace CSE {
10 public:
11 ReflectionObject() = default;
12
13 explicit ReflectionObject(std::string type) : m_class(std::move(type)) {}
14
15 virtual ~ReflectionObject() = default;
16
17 void SetClassType(std::string type) {
18 m_class = std::move(type);
19 }
20
21 const char* GetClassType() const {
22 return m_class.c_str();
23 }
24
25 bool IsSameClass(const char* classType) const {
26 return std::equal(m_class.begin(), m_class.end(), classType);
27 }
28
29 static ReflectionObject* NewObject(const std::string& name) {
30 return CORE->GetReflectionMgrCore()->CreateObject(name);
31 }
32
33 protected:
34 std::string m_class;
35 };
36}