ECS/Project/Project/ECS/EntityManager/EntityManager.cpp
//	Return a pointer to get the component of an Entity.
Return a pointer to get the component of an Entity.
Return a pointer to get the component of an Entity .
std::shared_ptr<Component> EntityManager::getComponentOfEntity(const long int & givenEntity, const ComponentType & componentTypeSignature, const ModuleType & requestingSystemSignature) const
{
	std::shared_ptr<Entity> entity = getEntity(givenEntity);
	if (entity != NULL)
	{
		if (entity->getDestroyed())
		{
			return NULL;
		}
		else
		{
			if (entity->hasComponents((long int)componentTypeSignature))
			{
				eventDispatcher->dispatchToEventQueue(EventType::COMPONENT_CHANGED, requestingSystemSignature, componentTypeSignature, givenEntity);
				return entity->getComponentByType(componentTypeSignature);
			}
			else
			{
				return NULL;
			}
		}
	}
	else
	{
		return NULL;
	}
}
std :: shared_ptr < Component > EntityManager :: getComponentOfEntity ( const long int & givenEntity , const ComponentType & componentTypeSignature , const ModuleType & requestingSystemSignature ) const { std :: shared_ptr < Entity > entity = getEntity ( givenEntity ) ; if ( entity != NULL ) { if ( entity -> getDestroyed ( ) ) { return NULL ; } else { if ( entity -> hasComponents ( ( long int ) componentTypeSignature ) ) { eventDispatcher -> dispatchToEventQueue ( EventType :: COMPONENT_CHANGED , requestingSystemSignature , componentTypeSignature , givenEntity ) ; return entity -> getComponentByType ( componentTypeSignature ) ; } else { return NULL ; } } } else { return NULL ; } }
Return a pointer to get the component of an Entity.
Return a pointer to get the component of an Entity .
//	Return the entity and check if it exists. //	Check if the entity has already been destroyed. //	If the Entity was destroyed, return false. //	Check if the entity has the component. //	Dispatch the Event to the EventQueue. //	If it does have the component, return it. //	If it does not have the component, return NULL. //	If the entity was never created, return NULL.