Last active
August 29, 2015 14:02
-
-
Save benatkin/1ea1baf73c5b6d24d611 to your computer and use it in GitHub Desktop.
lolz
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
enum EntreeType : Int { | |
case Burrito, BurritoBowl, CrispyTacos, SoftTacos, Salad | |
} | |
enum Filling : Int { | |
case Chicken, Steak, Barbacoa, Carnitas, Sofritas, Veggie | |
var price : Int { | |
get { | |
switch self { | |
case .Chicken, .Sofritas, .Veggie { | |
return 625 | |
} | |
default { | |
return 665 | |
} | |
} | |
} | |
} | |
enum Rice : Int { | |
case Brown, White | |
} | |
enum Beans : Int { | |
case Pinto, Black | |
} | |
struct ToppingSelection { | |
var fajitaVeggies = false | |
var freshTomatoSalsa = false | |
var roastedChiliCornSalsa = false | |
var tomatilloGreenChiliSalsa = false | |
var tomatilloRedChiliSalsa = false | |
var sourCream = false | |
var cheese = false | |
var guacamole = false | |
var lettuce = false | |
var price : Int { | |
get { | |
return guacamole ? 180 : 0 | |
} | |
} | |
} | |
struct EntreeOrder { | |
var entreeType: EntreeType | |
var filling: Filling | |
var rice: Rice? | |
var beans: Beans? | |
var toppings: ToppingSelection = ToppingSelection() | |
var price : Int { | |
get { | |
return entreeType.price + toppings.price | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment