Exemple #1
0
            public override void PrintError(CopyMachine copyMachine)
            {
                ConsolePrintHelper.WriteLabel("Произошла ошибка: ");
                ConsolePrintHelper.WriteLineValue(copyMachine.Error);

                copyMachine.State = new ReturnDeliveryState();
                copyMachine.State.ReturnDelivery(copyMachine);
            }
 public override void ReturnDelivery(CopyMachine copyMachine)
 {
     if (copyMachine.Cash > 0)
     {
         ConsolePrintHelper.WriteLabel("Возьмите сдачу: ");
         ConsolePrintHelper.WriteLineValue(copyMachine.Cash.ToString());
         copyMachine.Cash = 0;
     }
     copyMachine.State = new GoodbyeState();
     copyMachine.State.SayGoodbye(copyMachine);
 }