void Model::removeTheUndead() { Projectile* projectile; while (!_toRemoveProjectile.empty()) { projectile = _toRemoveProjectile.front(); this->getMyArmy(projectile->getArmyType())->removeProjectile(projectile); _toRemoveProjectile.pop_front(); delete projectile; } Unit* unit; while (!_toRemoveUnit.empty()) { unit = _toRemoveUnit.front(); this->getMyArmy(unit->getArmyType())->removeUnit(unit); _toRemoveUnit.pop_front(); delete unit; } }