Exemplo n.º 1
0
Display::~Display(){
	for (LinkedList* i = _instances; i != NULL; i = i->next){
		if (i->data == this){
			// if removing the first element, manually set _instances to the next node
			if (i == _instances){
				_instances = _instances->next;
			}
			linkedlistRemove(i);
			return;
		}
	}
	// ERROR
	sassert(false, "Display* not found");
}
Exemplo n.º 2
0
void EntityManager::Remove(Entity* entity)
{
	for(LinkedList* node = mEntities; node != NULL; node = node->next)
	{
		Entity* current = (Entity*) node->data;
		if(current == entity)
		{
			mNumEntities--;
			delete current;
			linkedlistRemove(node);
			return;
		}
	}
}