Esempio n. 1
0
        public void dispense()
        {
            gumballMachine.releaseBall();
            if (gumballMachine.BallsInventory > 0)
            {
                gumballMachine.CurrentState = gumballMachine.getHasNoQuarterState();
                return;
            }

            gumballMachine.CurrentState = gumballMachine.getSoldOutState();
        }
Esempio n. 2
0
        public void dispense()
        {
            Console.WriteLine("YOU ARE THE WINNER! Here you have the 2nd ball!");
            gumballMachine.releaseBall();
            if (gumballMachine.BallsInventory > 0)
            {
                gumballMachine.CurrentState = gumballMachine.getHasNoQuarterState();
                return;
            }

            gumballMachine.CurrentState = gumballMachine.getSoldOutState();
        }