Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class CarFleet {
func moveCarsToPosition(cars: [Car], position: Position) {
cars.forEach({
if Toggles.Vehical.carsCanFly.enabled {
fly(to: location)
} else {
drive(to: location)
}
})
}
func refuel(cars: [Car]) {
cars.forEach({
if Toggles.Vehicle.Car.carsCanFly.enabled {
refuel(car: $0, using: Fuel.rocket)
} else {
refuel(car: $0, using: Fuel.car)
}
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment