Added Wren API endpoints + random cleanup

This commit is contained in:
Antoine Pilote
2023-07-17 01:49:32 -04:00
parent 0534c0fd81
commit 415f6dd5cd
3 changed files with 8 additions and 4 deletions

View File

@@ -179,12 +179,14 @@ namespace Nuake {
Entity Scene::GetEntity(const std::string& name)
{
std::vector<Entity> allEntities;
auto view = m_Registry.view<TransformComponent, NameComponent>();
const auto& view = m_Registry.view<NameComponent>();
for (auto e : view)
{
auto [transform, namec] = view.get<TransformComponent, NameComponent>(e);
const auto& namec = view.get<NameComponent>(e);
if (namec.Name == name)
{
return Entity{ e, this };
}
}
return Entity();