예제 #1
0
 public IGumballMachineState InsertCoin()
 {
     Console.WriteLine("Coin inserted.");
     return(HasCoinState.GetInstance());
 }
예제 #2
0
 public static IGumballMachineState GetInstance()
 {
     return(_instance ?? (_instance = new HasCoinState()));
 }