public VendingMachine() { MachineOutput.DisplayInstructions(); MoneyInsertedState = new MoneyInsertedState(this); NoMoneyInsertedState = new NoMoneyInsertedState(this); CurrentState = new NoMoneyInsertedState(this); }
public void SelectItem(string itemInput) { if (!ItemQueues.ContainsKey(itemInput)) { return; } var itemQueue = ItemQueues[itemInput]; if (itemQueue.IsInStock()) { CurrentState.SelectItem(itemQueue); } else { MachineOutput.DisplaySoldOutError(); } }
//Intentionally left here for debugging/visibility. In an actual release this would not be present. public void Status() { MachineOutput.QueueStatus(_itemQueue.Peek().Name, _itemQueue.Peek().Flavor, _itemQueue.Peek().WrapperColor, (_itemQueue.Count - 1)); }
public void Report() { MachineOutput.ReportTrashStatus(Wrappers); }