Skip to content

Instantly share code, notes, and snippets.

@fitomad fitomad/factory-factory.swift Secret
Created Oct 15, 2018

What would you like to do?
public class RoverFactory
Construimos un nuevo Rover para que explore un entorno
public static func makeRover(for explore: Exploration) -> Rover
switch explore
case .aerial:
return AirRover(named: "Curiosity")
case .terrestrial:
return LandRover(named: "Spirit")
case .nautical:
return SeaRover(named: "ExoMars")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.