static void Main(string[] args) { var drinkFactory = new DrinkFactory(); var largeEspresso = drinkFactory.GetDrink("Espresso"); largeEspresso.Serve("Large"); var mediumSmoothie = drinkFactory.GetDrink("BananaSmoothie"); mediumSmoothie.Serve("Medium"); var smallEspresso = drinkFactory.GetDrink("Espresso"); smallEspresso.Serve("Small"); drinkFactory.ListDrinks(); var sizes = new string[] { "Small", "Medium", "Large" }; foreach (var size in sizes) { var giveaway = drinkFactory.CreateGiveaway(); giveaway.Serve(size); } }
static void Main(string[] args) { IDrink drink = DrinkFactory.GetDrink(DrinkType.Cola); Console.WriteLine(drink); drink = DrinkFactory.GetDrink(DrinkType.Fanta); Console.WriteLine(drink); // Tries to get drink which is not available in shop, // as a result receives NullObject. drink = DrinkFactory.GetDrink(DrinkType.Pepsi); Console.WriteLine(drink); drink = DrinkFactory.GetDrink(DrinkType.Sprite); Console.WriteLine(drink); Console.WriteLine("Please enter any key to exit..."); Console.ReadKey(); }
static void Main(string[] args) { var drinkFactory = new DrinkFactory(); var largeEspresso = drinkFactory.GetDrink(500, "Espresso"); largeEspresso.Serve(); var mediumCoffee = drinkFactory.GetDrink(250, "Coffee"); mediumCoffee.Serve(); var mediumEspresso = drinkFactory.GetDrink(250, "Espresso"); mediumEspresso.Serve(); var mediumTea = drinkFactory.GetDrink(250, "Tea"); mediumTea.Serve(); var largeCocaCola = drinkFactory.GetDrink(500, "CocaCola"); largeCocaCola.Serve(); var largeSprite = drinkFactory.GetDrink(500, "Sprite"); largeSprite.Serve(); var largePepsi = drinkFactory.GetDrink(500, "Pepsi"); largePepsi.Serve(); var mediumSprite = drinkFactory.GetDrink(500, "Sprite"); mediumSprite.Serve(); drinkFactory.ListDrinks(); }
static void Main(string[] args) { //Image imageEuropeAfrica = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_Europe_Africa_8k_9-21.jpg"); //Image imageSouthAmerica = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_SouthAmerica_8k_9-21.jpg"); //Image imageSouthAmericaCrop = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_SouthAmericaCrop_8k_9-21.jpg"); //Image imageEuropeIndia = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_Europe-India_8k_9-21.jpg"); //Image imageNorthAmerica = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_NorthAmerica_8k_9-21.jpg"); //Image imageEurope = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_Europe_8k_9-21.jpg"); //Image imageWorld = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_World_8k_9-21.jpg"); //Image imageAsia = Image.FromFile("..\\..\\..\\GLIF2017_maps_9-21\\GLIF2017_Asia_8k_9-21.jpg"); var factory = new DrinkFactory(); factory.GetDrink("Espresso"); factory.GetDrink("Coffee"); factory.GetDrink("Tea"); factory.GetDrink("CocaCola"); factory.GetDrink("Pepsi"); factory.GetDrink("Sprite"); }