Added EntityExists and HasComponent
This commit is contained in:
@@ -25,8 +25,17 @@ Entity World::CreateEntity() {
|
||||
}
|
||||
|
||||
bool World::EntityExists(const Entity &entity) noexcept {
|
||||
// TO BE IMPLEMENTED
|
||||
return true;
|
||||
bool exists = false;
|
||||
entityComponentMap.scan(
|
||||
[&exists, entity](const Tourmaline::Type::UUID ¤tEntity,
|
||||
const std::type_index &, std::any &) -> bool {
|
||||
if (currentEntity == entity) {
|
||||
exists = true;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
});
|
||||
return exists;
|
||||
}
|
||||
|
||||
bool World::DestroyEntity(Entity entity) {
|
||||
|
||||
Reference in New Issue
Block a user