示例#1
0
        static void Main(string[] args)
        {
            GumballStateMachine machine = new GumballStateMachine(2);

            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.ejectQuarter();
            machine.insertQuarter();
            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.turnCrank();
            machine.refill();
            machine.insertQuarter();
            machine.turnCrank();
            machine.insertQuarter();
            machine.ejectQuarter();
            machine.insertQuarter();
            machine.insertQuarter();
            machine.turnCrank();

            System.Console.ReadLine();
        }
示例#2
0
 public NoQuarter(GumballStateMachine gsm)
 {
     machine = gsm;
 }
示例#3
0
 public Sold(GumballStateMachine gsm)
 {
     machine = gsm;
 }