6#include "../../../thirdparty/uuid/UUID.hpp"
11 : m_engine(engine), m_entity(m_engine.getRegistry().create()), m_isValid(true)
13 m_engine.getRegistry().add_or_replace<NameComponent>(m_entity, name);
14 auto* scene = m_engine.getSceneManager()->GetScene(m_engine.getSceneManager()->getLastSceneName());
16 scene->RegisterGameObject(this);
21 if (!m_isValid)
return;
23 log(
"[GameObject] Destroying entity ID: %d", (
int)m_entity);
32 m_engine.getRegistry().destroy(m_entity);
Contains basic components like transform, camera, name components..
This file defines the GameObject class.
This file defines SceneManager class.
This file defines SceneManager class.
Class for interaction with engine systems.
void Destroy()
Destroys the GameObject and removes it from the engine's registry.
GameObject(Engine &engine, const std::string &name)
Default constructor for GameObject.
virtual ~GameObject()
Destructor.
Provides iteration over entities that have all specified component types.
void each(Func func)
Iterates over all entities with the specified component types.
uint32_t Entity
Type alias representing a unique entity identifier in the ECS system.
void VEX_EXPORT log(const char *fmt,...)
Logs a formatted message.
constexpr Entity NULL_ENTITY
Special entity value indicating an invalid or null entity.