This file contains hidden or 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 Refuelable { | |
| func refuel() | |
| } | |
| protocol Drivable { | |
| func drive() | |
| } | |
| struct Car: Refuelable, Drivable {} |
This file contains hidden or 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
| struct Car: Refuelable, Drivable {} | |
| struct Motorbike: Refuelable, Rideable {} | |
| struct CleanerCar: Refuelable, Drivable, Cleaner {} | |
| struct MechanicRobot: VehicleFinder, Maintainer {} | |
| struct CleanerRobot: VehicleFinder, Cleaner {} |
This file contains hidden or 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 Refuelable { | |
| func refuel() | |
| } | |
| protocol Drivable { | |
| func drive() | |
| } | |
| protocol Rideable { | |
| func ride() |
This file contains hidden or 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
| Car = Refuelable + Drivable; | |
| Motorbike = Refuelable + Rideable; | |
| CleanerCar = Refuelable + Driveable + Cleaner; | |
| MechanicRobot = VehicleFinder + Maintainer; | |
| CleanerRobot = VehicleFinder + Cleaner; |
This file contains hidden or 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 Vehicle { | |
| func refuel() | |
| } | |
| class Car: Vehicle { | |
| func drive() | |
| } | |
| class CleanerCar: Car { | |
| func cleanVehicle() //DUPLICATE |
This file contains hidden or 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 GlobalObject { | |
| func cleanVehicle() | |
| } | |
| class Vehicle: GlobalObject { | |
| func refuel() | |
| } | |
| class Car: Vehicle { | |
| func drive() |
This file contains hidden or 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 Vehicle { | |
| func refuel() | |
| } | |
| class Car: Vehicle { | |
| func drive() | |
| } | |
| class Motorbike: Vehicle { | |
| func ride() |
This file contains hidden or 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 Robot { | |
| func findVehicle() | |
| } | |
| class Mechanic: Robot { | |
| func maintainVehicle() | |
| } | |
| class Cleaner: Robot { | |
| func cleanVehicle() |
This file contains hidden or 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 CleanerRobot { | |
| func findVehicle() | |
| func cleanVehicle() | |
| } |
This file contains hidden or 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 MechanicRobot { | |
| func findVehicle() | |
| func maintainVehicle() | |
| } |
NewerOlder