Skip to content

Instantly share code, notes, and snippets.

@fitomad
Created October 15, 2018 09:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fitomad/96c4a52e3a2ec5ffefeb3ce62c9d436f to your computer and use it in GitHub Desktop.
Save fitomad/96c4a52e3a2ec5ffefeb3ce62c9d436f to your computer and use it in GitHub Desktop.
public protocol Rover
{
/// Nombre del Rover
var name: String { get }
/// Estado de la batería
var batteryLevel: Int { get }
/// Velocidad actual
var speed: Double { get }
/**
Los construimos con un nombre único
*/
init(named name: String)
/// Orden de movimiento a unas determinadas coordenadas
func move(to position: CLLocation) -> Bool
/// El Rover debe deterse
func stop() -> Void
/// Llega el invierno
func hibernate() -> Void
/// Empieza a realizar los experimientos
func startExperiment() -> Void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment