Last active
July 26, 2017 05:59
-
-
Save wmarshall484/434491e6319f558e4590b41852146080 to your computer and use it in GitHub Desktop.
A recipe for sauteed chicken
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
from stores import Safeway | |
from ingredients import Meats, Oils, Vegetables, Spices | |
from kitchen import Pan, Stove, Plate | |
from life import Girlfriend, Me | |
import common_steps, units, time | |
class Recipe(object): | |
def __init__(self, name, description=None, cook_time=None): | |
self.name = name | |
self.description = description | |
self.cook_time = cook_time | |
class StovetopRecipe(Recipe): | |
def __init__(self, name, description=None, cook_time=None): | |
super(StovetopRecipe).__init__(name, description, cook_time) | |
self.pan = new Pan() | |
self.stove = new Stove() | |
class SauteedChicken(StovetopRecipe): | |
def __init__(self, name, description=None, cook_time=None): | |
super(SauteedChicken).__init__(name, description, cook_time) | |
self.chicken = Safeway.purchase(Meats.CHICKEN, 1, units.BREAST) | |
self.canola_oil = Safeway.purchase(Oils.CANOLA, 1, units.TABLESPOON) | |
self.garlic = Safeway.purchase(Vegetables.GARLIC, 4, units.CLOVES) | |
self.white_onion = Safeway.purchase(Vegetables.WHITE_ONION, 1, units.ITEM) | |
self.salt = Safeway.purchase(Spices.SALT, 1, units.TEASPOON) | |
self.pepper = Safeway.purchase(Spices.PEPPER, 1, units.TEASPOON) | |
def prepare(self): | |
self.chicken = common_steps.slice(self.chicken) | |
self.garlic = common_steps.mince(self.garlic) | |
self.white_onion = common_steps.chop(self.white_onion) | |
def cook(self): | |
self.pan.place(self.stove) | |
self.stove.heat(stove.StoveTemps.MEDIUM) | |
self.pan.add(self.canola_oil) | |
time.sleep(60) | |
self.pan.addall([self.garlic, self.white_onion, self.salt, self.pepper]) | |
for i in range(10): | |
self.pan.stir() | |
time.sleep(20) | |
self.pan.add(self.chicken) | |
while not self.chicken.is_cooked(): | |
time.sleep(120) | |
for slice in chicken.slices: | |
slice.flip() | |
self.stove.heat(stove.StoveTemps.OFF) | |
def serve(self): | |
plate = new Plate() | |
plate.add(pan.contents) | |
try: | |
Girlfriend.serve(plate) | |
except ConstructiveCriticismException: | |
Me.cry() | |
Me.clean() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment