void ComponentManager::postPerform()
{
	for(unsigned int i=0; i<m_deleteComponentsByTypeOnPostPerform.size(); i++)
	{
		int typeIndex = m_deleteComponentsByTypeOnPostPerform[i].first;
		int entityIndex = m_deleteComponentsByTypeOnPostPerform[i].second;
		m_componentsByType[typeIndex][entityIndex] = NULL;
	}
	m_deleteComponentsByTypeOnPostPerform.clear();

	// Remove all components here!
	for (unsigned int i = 0; i < m_deleted.size(); i++)
	{
		removeComponentsOfEntity(m_deleted[i]);
	}
	m_deleted.clear();

	// Delete components here!
	for (unsigned int i = 0; i < m_deleteOnPost.size(); i++)
	{
		delete m_deleteOnPost[i];
	}
	m_deleteOnPost.clear();

}
Beispiel #2
0
	void EntityManager::remove(Entity& e) {
		activeEntities.set(e.getId(), NULL);
		e.setTypeBits(0);
		refresh(e);
		removeComponentsOfEntity(e);
		count--;
		totalRemoved++;
		removedAndAvailable.add(&e);
	}