2#include "Core/Engine/ECS/Common.h"
61 bool IsValid() const noexcept {
return m_component !=
nullptr; }
67 T&
Get() const noexcept {
return *m_component; }
78 operator bool()
const {
return IsValid(); }
This class provides a handle to a component.
Definition Component.h:52
T * operator->() const
Get the component.
Definition Component.h:73
T & Get() const noexcept
Get the component.
Definition Component.h:67
bool IsValid() const noexcept
Checks if the component is valid.
Definition Component.h:61
Class to represent an entity in an ECS Context.
Definition Entity.h:10
Abstract base class for component containers.
Definition Component.h:12
virtual void OnRemove(Entity *entity)=0
Pure virtual method called when an entity is removed.
virtual ~ComponentContainerBase()=default
Virtual destructor.
Template class for component containers (concrete implementation of ComponentContainerBase)
Definition Component.h:31
virtual void OnRemove(Entity *entity) override
Method called when an entity is removed.
Definition ECS.h:142