Skip to content

Instantly share code, notes, and snippets.

@mayooresan

mayooresan/war.swift

Last active Aug 11, 2017
Embed
What would you like to do?
protocol WarCapable {
var topSpeed : Double {get set}
var shotsPerMinute : Int {get set}
}
protocol SpyCapable {
var numberOfCameras : Int {get set}
}
class WarTank : WarCapable {
var topSpeed: Double = 100.0
var shotsPerMinute: Int = 5
}
class SpyJeep : WarCapable, SpyCapable{
var topSpeed: Double = 200
var shotsPerMinute: Int = 1
var numberOfCameras: Int = 5
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment