feat(ecs): add "add" function to Entity

This commit is contained in:
light7734 2025-09-25 22:23:32 +03:30
parent fa1bfaae1e
commit 34fa8344ac
Signed by: light7734
GPG key ID: 8C30176798F1A6BA

View file

@ -15,6 +15,12 @@ public:
ensure(m_registry, "Failed to create Entity ({}): null registry", m_identifier); ensure(m_registry, "Failed to create Entity ({}): null registry", m_identifier);
} }
template<typename Component_T>
auto add(Component_T component) -> Component_T &
{
return m_registry->add(m_identifier, component);
}
template<typename Component_T> template<typename Component_T>
auto get() -> Component_T & auto get() -> Component_T &
{ {