light/modules/ecs/private/scene.cpp

32 lines
707 B
C++
Raw Normal View History

2025-07-11 01:16:52 +03:30
#include <ecs/components.hpp>
#include <ecs/entity.hpp>
#include <ecs/scene.hpp>
2025-07-11 00:05:48 +03:30
namespace lt {
2025-07-06 14:02:50 +03:30
auto Scene::create_entity(const std::string &name, const TransformComponent &transform) -> Entity
2022-03-07 21:57:00 +03:30
{
return create_entity_with_uuid(name, UUID(), transform);
2022-03-07 21:57:00 +03:30
}
2025-07-06 14:02:50 +03:30
auto Scene::get_entity_by_tag(const std::string &tag) -> Entity
2022-03-07 21:57:00 +03:30
{
2025-07-06 16:30:38 +03:30
return {};
2022-03-07 21:57:00 +03:30
}
2025-07-06 14:02:50 +03:30
auto Scene::create_entity_with_uuid(
2025-07-05 13:28:41 +03:30
const std::string &name,
UUID uuid,
const TransformComponent &transform
2025-07-06 14:02:50 +03:30
) -> Entity
2022-03-07 21:57:00 +03:30
{
2025-07-06 14:02:50 +03:30
auto entity = Entity { m_registry.create(), this };
entity.add_component<TagComponent>(name);
entity.add_component<TransformComponent>(transform);
entity.add_component<UUIDComponent>(uuid);
2022-03-07 21:57:00 +03:30
return entity;
}
2022-03-07 21:57:00 +03:30
2025-07-11 00:05:48 +03:30
} // namespace lt