Created
March 31, 2018 10:08
-
-
Save iamcrypticcoder/8ae5247adec2006f17c01f24fd0852d0 to your computer and use it in GitHub Desktop.
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 Foundation | |
var book1: Book = Book() | |
var executor: CommandExecutor = CommandExecutor() | |
executor.addCommand(BuyCommand(book1)) | |
executor.runCommand() | |
print("Current owner: \(book1.currentOwner!)") | |
executor.addCommand(GiftFriendCommand(book1, "Mahbub")) | |
executor.addCommand(SellCommand(book1)) | |
executor.runCommand() | |
print("Current owner: \(book1.currentOwner!)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment