Esempio n. 1
0
void Hex::RemoveShip(ShipType type, Colour colour)
{
    for (auto fleetIt = m_fleets.begin(); fleetIt != m_fleets.end(); ++fleetIt)
        if (fleetIt->GetColour() == colour)
        {
            fleetIt->RemoveShip(type);
            if (fleetIt->GetSquadrons().empty())
                m_fleets.erase(fleetIt);
            return;
        }

    VERIFY_MODEL(false);
}
Esempio n. 2
0
void UFlareFleet::RemoveImmobilizedShips()
{
	TArray<UFlareSimulatedSpacecraft*> ShipToRemove;

	for (int ShipIndex = 0; ShipIndex < FleetShips.Num(); ShipIndex++)
	{
		if (!FleetShips[ShipIndex]->CanTravel())
		{
			ShipToRemove.Add(FleetShips[ShipIndex]);
		}
	}

	for (int ShipIndex = 0; ShipIndex < ShipToRemove.Num(); ShipIndex++)
	{
		RemoveShip(ShipToRemove[ShipIndex]);
	}
}