21 IDLE = 0, INIT = 1, DESTROY = -1, UNKOWN = -2
28 explicit SGameObject(std::string name, std::string hash);
34 virtual void Tick(
float elapsedTime);
36 void Exterminate()
override;
43 void SetUndestroyable(
bool enable)
override;
47 void RemoveChildren(
bool isAllLevel =
false);
57 const std::list<SGameObject*>& GetChildren()
const;
69 T* GetComponentByHash(
const std::string&
id)
const;
71 SComponent* GetSComponentByHash(
const std::string& hash)
const;
73 const std::list<SComponent*>& GetComponents()
const;
75 HSQOBJECT GetCustomComponent(
const char* className);
90 static SGameObject* FindByHash(
const std::string& hash);
93 std::string GetName()
const {
97 std::string GetID()
const;
99 std::string GetID(
const SComponent* component)
const;
101 void SetName(std::string name) {
102 m_name = std::move(name);
109 STATUS GetStatus()
const {
113 bool GetIsEnable()
const;
115 void SetIsEnable(
bool is_enable);
117 void SetHash(std::string& hash)
override;
120 void UpdateComponent(
float elapsedTime);
123 std::list<SGameObject*> m_children;
126 std::list<SComponent*> m_components;
129 bool isEnable =
true;
130 STATUS m_status = INIT;
131 bool m_isPrefab =
false;
132 std::string m_resourceID;
134 bool isPrefab(
bool OnlyThisObject =
false)
const;
136 void SetIsPrefab(
bool m_isPrefab);
138 std::string GetResourceID()
const;
140 void SetResourceID(
const std::string& resID,
bool setChildren =
false);