You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
lunarium_OLD/src/world/entity.cpp

42 lines
924 B
C++

/******************************************************************************
* File - entity.cpp
* Author - Joey Pollack
* Date - 2022/05/23 (y/m/d)
* Mod Date - 2022/05/23 (y/m/d)
* Description - Provides functionality to work with world entities
******************************************************************************/
#include "entity.h"
#include "world.h"
namespace lunarium
{
Entity::Entity(World& w)
: mHandle(entt::null), mWorld(w)
{
mUUID = UUID::GetNewID();
Init();
}
Entity::Entity(World& w, LUUID uuid, entt::entity handle)
: mHandle(handle), mWorld(w), mUUID(uuid)
{
Init();
}
void Entity::Init()
{
mHandle = mWorld.GetEntityRegistry()->create();
}
LUUID Entity::GetUUID() const
{
return mUUID;
}
bool Entity::HasChildren() const
{
return mChildren.size() > 0;
}
}