6 return _entityId.AddComponent(
GetCore(), std::forward<TComponent>(component));
11 return _entityId.AddComponent<TComponent>(
GetCore(), std::forward<TArgs>(args)...);
16 return _entityId.AddComponentIfNotExists<TComponent>(
GetCore(), std::forward<TArgs>(args)...);
21 return _entityId.AddTemporaryComponent<TTempComponent>(
GetCore(), std::forward<TArgs>(args)...);
47template <
typename FormatContext>
48auto fmt::formatter<Engine::Entity>::format(
const Engine::Entity &entity, FormatContext &ctx)
const
50 return fmt::formatter<Engine::EntityId>::format(entity.
Id(), ctx);
Wrapper class providing a convenient interface for entity manipulation with the Core....
Definition Entity.hpp:20
decltype(auto) AddComponentIfNotExists(TArgs &&...args)
Add a component to an entity if it does not already exist.
Definition Entity.ipp:14
EntityId Id() const
Get the EntityId associated with this Entity.
Definition Entity.cpp:11
decltype(auto) AddTemporaryComponent(TArgs &&...args)
Add a temporary component to an entity. Temporary component are removed when calling RemoveTemporaryC...
Definition Entity.ipp:19
Core & GetCore() const
Get a reference to the Core instance that this Entity belongs to. This is used internally to access t...
Definition Entity.cpp:21
decltype(auto) AddComponent(TComponent &&component)
Add a component to an entity.
Definition Entity.ipp:4
decltype(auto) TryGetComponent()
Try to get a component of type TComponent from the entity. It returns a pointer to the component if i...
Definition Entity.ipp:41
bool HasComponents() const
Check if entity have one or multiple component's type.
Definition Entity.ipp:26
EntityId _entityId
The EntityId that identifies the entity in the Core's registry. This is the underlying identifier for...
Definition Entity.hpp:129
decltype(auto) GetComponents()
Get components of type TComponent from the entity.
Definition Entity.ipp:31
void RemoveComponent()
Remove a component from an entity.
Definition Entity.ipp:24