Ejemplo n.º 1
0
 public static HotChocolate getInstance()
 {
     if (instance == null)
     {
         instance = new HotChocolate();
     }
     return(instance);
 }
Ejemplo n.º 2
0
        public IDrink DrinkMachine(string drink)
        {
            switch (drink)
            {
            case "Tea": return(new Tea());

            case "Coffee": return(new Coffee());

            case "Hot chocolate": return(HotChocolate.getInstance());

            default: return(new DefaultDrink());
            }
        }