2
3
4
5
9#include "World/Entity.h"
35 std::unique_lock<std::shared_mutex> lock(m_Mutex);
37 m_Registry.destroy(entity);
38 m_RootEntityMap.erase(entity.GetUUID());
45 return id == -1 ? Entity() : Entity((entt::entity)id,
this);
62 std::unique_lock<std::shared_mutex> lock(m_Mutex);
64 m_RootEntityMap.erase(entity.GetUUID());
71 std::unique_lock<std::shared_mutex> lock(m_Mutex);
73 m_RootEntityMap[entity.GetUUID()] = entity;
80 std::shared_lock<std::shared_mutex> lock(m_Mutex);
82 return m_RootEntityMap.find(entity.GetUUID()) != m_RootEntityMap.end();
89 std::unique_lock<std::shared_mutex> lock(m_Mutex);
91 Entity entity(m_Registry.create(),
this);
92 m_RootEntityMap[uuid] = entity;
#define SPICES_PROFILE_ZONE
Entity Class. This class defines the specific behaves of Entity.
TagComponent Class. This class defines the specific behaves of TagComponent.
UUIDComponent Class. This class defines the specific behaves of UUIDComponent.
UUID()
Constructor Function.
This class helps to generate a uuid for one resource.
Entity CreateEntity(const std::string &name="None")
Create a new empty entity in this world.
Entity CreateEmptyEntity(UUID uuid)
Entity CreateEntityWithUUID(UUID uuid, const std::string &name="None")
Create a new empty entity with a uuid in this world.
Entity QueryEntitybyID(uint32_t id)
Get World Entity by id(entt::entity).
void DestroyEntity(Entity &entity)
Destroy a entity from this world.
WorldMarkFlags m_Marker
World State this frame.
void RemoveFromRoot(Entity &entity)
Remove a entity from this world root.
void AddToRoot(Entity &entity)
Add a entity to this world root.
bool IsRootEntity(Entity &entity)
Determine if a entity is in root.
void ClearMarkerWithBits(WorldMarkFlags flags)
Clear WorldMarkFlags with flags.
World Class. This class defines the basic behaves of World. When we create an new world,...