private void DeliverOrder(Order o) { print("Delivering " + o); // marketGui.DoPlateIt(/*o.choicename*/); cashier.msgRestockingBill(this, o.food.type, o.food.orderamt * o.food.price); o.c.msgOrderDone(this, o.food.type, o.food.orderamt); o.s = OrderState.finished; }
public void RestockDone(Order o) { o.food.inventory = o.food.inventory - o.food.orderamt; o.s = OrderState.done; print("Done restocking " + o.food); System.out.print(o.food.inventory + "\n"); // o.c.msgOrderDone(o.food.type); stateChanged(); }
private void TryRestockOrder(final Order o) { if (o.food.inventory == 0) { print("OUT of " + o.food); o.s = OrderState.finished; o.c.msgOutofChoice(this, o.food.type); return; } else { print("Restocking " + o); System.out.print(o.food.inventory + "\n"); // marketGui.DoRestocking(); o.s = OrderState.restocking; restockingtimer.schedule( new TimerTask() { public void run() { RestockDone(o); } }, o.food.stockingTime * 1000); } }