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