Created
February 20, 2011 23:50
-
-
Save jesjos/836432 to your computer and use it in GitHub Desktop.
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
process mainLoop { | |
MyTime t; | |
while (numberOfDrinks < Constants.MAX_DRINKS) { | |
t = new MyTime(clock.getTime().getValue()); | |
drink = orderQueue(myOrder, t); | |
if (drink instanceof Landlord.Refusal) { | |
System.out.println("Customer says: I was refused!!!! I'll return later with an AK-47 and blast the place."); | |
break; | |
} | |
numberOfDrinks++; | |
// Go to table | |
// Drink | |
// Clean out surplus alarms | |
while (alarm.length() > 0) | |
receive alarm(); | |
// | |
send clock.setAlarm(alarm, Constants.DRINK_TIME); | |
inni void alarm() { | |
} | |
[] void lastCall() st (myOrder == Constants.Order.BEER) { | |
numberOfDrinks = 4; | |
System.out.println("I received a last call message."); | |
} | |
// Place drink on table | |
if (drink instanceof ServingArea.Cup) { | |
call putCup((ServingArea.Cup) drink); | |
} else { | |
call putGlass((ServingArea.Glass) drink); | |
} | |
drink = null; | |
} | |
System.out.println("Customer going home."); | |
send handShake(this); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment