1#include <Engine/Scene/System.hpp>
3#include <Engine/Scene/Component.hpp>
4#include <Engine/Scene/Entity.hpp>
13 CORE_ASSERT( component->
getEntity() == ent,
"Component does not belong to entity" );
15 CORE_ASSERT( pair.second != component,
"Component already registered" );
16 if ( pair.first == ent ) {
17 CORE_ASSERT( pair.second->getName() != component->
getName(),
18 "A component with the same name is already associated with this entity" );
27 CORE_ASSERT( component->
getEntity() == ent,
"Component does not belong to entity" );
31 return pair.second == component;
34 CORE_ASSERT( pos !=
m_components.end(),
"Component is not registered." );
35 CORE_ASSERT( pos->first == ent,
"Component belongs to a different entity" );
44 return pair.first == entity;
53 if ( ec.first == entity ) { comps.
push_back( ec.second ); }
A component is an element that can be updated by a system. It is also linked to some other components...
virtual const std::string & getName() const
Return the component's name.
virtual Entity * getEntity() const
Return the entity the component belongs to.
virtual void setSystem(System *system)
Set the system to which the component belongs.
An entity is an scene element. It ties together components with a transform.
std::vector< Component * > getEntityComponents(const Entity *entity)
std::vector< std::pair< const Entity *, Component * > > m_components
List of active components.
virtual void unregisterAllComponents(const Entity *entity)
virtual void registerComponent(const Entity *entity, Component *component)
virtual void unregisterComponent(const Entity *entity, Component *component)
hepler function to manage enum as underlying types in VariableSet