28 SPARK_ALLOW_PRIVATE_SERIALIZATION
41 template <
typename T =
GameObject,
typename... Args>
requires std::is_base_of_v<GameObject, T>
42 static T* Instantiate(std::string name,
GameObject* parent, Args&&... args);
49 static void Destroy(
GameObject*
object,
bool immediate =
false);
86 [[nodiscard]]
const lib::Uuid& uuid()
const;
92 [[nodiscard]]
const std::string& name()
const;
105 void addComponent(
Component* component,
bool managed =
false);
113 template <
typename T,
typename... Args>
requires std::is_base_of_v<Component, T>
114 void addComponent(Args&&... args);
120 void removeComponent(
Component* component);
126 template <
typename T>
requires std::is_base_of_v<Component, T>
127 void removeComponent();
134 template <
typename T>
requires std::is_base_of_v<Component, T>
135 [[nodiscard]]
bool hasComponent()
const;
141 [[nodiscard]] std::vector<Component*> components()
const;
148 template <
typename T>
requires std::is_base_of_v<Component, T>
149 [[nodiscard]] std::vector<T*> componentsInChildren()
const;
156 template <
typename T>
requires std::is_base_of_v<Component, T>
157 [[nodiscard]] T* component()
const;
164 template <
typename T>
requires std::is_base_of_v<Component, T>
165 [[nodiscard]] T* componentInChildren()
const;
172 template <
typename T>
requires std::is_base_of_v<Component, T>
173 [[nodiscard]] T* componentInParent()
const;
184 virtual void onUpdate(
float dt) { SPARK_UNUSED(dt); }