This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class HomeBaseVC: UIViewController, SpyDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
func didFindWeaponOfMassDestruction(found: Bool) { | |
// Handle the received data here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
protocol SpyDelegate { | |
func didFindWeaponOfMassDestruction(found : Bool) | |
} | |
class EnemyBaseVC: UIViewController { | |
let hasWeaponOfMassDescrtruction : Bool = true | |
var delegate : SpyDelegate? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import UIKit | |
class HomeBaseVC: UIViewController, SpyDelegate { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
} | |
func didFindWeaponOfMassDestruction(found: Bool) { | |
// Handle the received data here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol WarCapable { | |
var topSpeed : Double {get set} | |
var shotsPerMinute : Int {get set} | |
} | |
protocol SpyCapable { | |
var numberOfCameras : Int {get set} | |
} | |
class WarTank : WarCapable { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//War tank objects | |
var t10 = WarTank() | |
var t11 = WarTank() | |
t11.topSpeed = 110.0 | |
//Spy Jeep Objects | |
var sj10 = SpyJeep() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Extensions | |
extension WarCapable{ | |
func canTravelFaster(item : WarCapable)->Bool{ | |
return self.topSpeed < item.topSpeed | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//War tank objects | |
var t10 = WarTank() | |
var t11 = WarTank() | |
t11.topSpeed = 110.0 | |
//Spy Jeep Objects | |
var sj10 = SpyJeep() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SpyBike : SpyCapable{ | |
var numberOfCameras: Int = 1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Spy Bike Objects | |
var sp10 = SpyBike() | |
var sp11 = SpyBike() | |
sp11.numberOfCameras = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protocol WarCapable { | |
var topSpeed : Double {get set} | |
var shotsPerMinute : Int {get set} | |
} | |
protocol SpyCapable { | |
var numberOfCameras : Int {get set} | |
} | |
class WarTank : WarCapable { |