Пример #1
0
        static void Main(string[] args)
        {
            CandyMachine candyMachine = new CandyMachine(10);

            for (int i = 0; i < 10; i++)
            {
                Console.WriteLine("This is {0} times.", i + 1);
                candyMachine.InsertQuarter();
                candyMachine.TurnQuarter();
                Console.WriteLine();
            }
        }
Пример #2
0
 public SoldState(CandyMachine machine)
 {
     candyMachine = machine;
 }
 public NoQuarterState(CandyMachine machine)
 {
     candyMachine = machine;
 }
Пример #4
0
 public WinnerState(CandyMachine machine)
 {
     candyMachine = machine;
 }