static void PrintBeverage(IBeverage b) { Console.Write( "Name: " + b.GetName() + " \nCost: " + b.GetCost() + "\n" ); }
public override Queue <string> GetName() { var q = b.GetName(); var tmp = base.GetName(); foreach (var str in tmp) { q.Enqueue(str); } return(q); }
public override Queue <string> GetName() { var que = beverage.GetName(); var tmp = base.GetName(); foreach (var str in tmp) { que.Enqueue(str); } return(que); }
public IBeverage ToBrew() { IBeverage[] finishedDrinks = new IBeverage[] { new Latte(), new Americano(), new Cappuccino(), new Macchiato(), new Mocha(), new Espresso() }; IBeverage finishedDrink = finishedDrinks.FirstOrDefault(f => Enumerable.SequenceEqual(f.GetIngredients.OrderBy(i => i), this.Ingredients.OrderBy(i => i)) ); finishedDrink = (finishedDrink == null) ? new UnknownDrink() : finishedDrink; Console.WriteLine("Brew complete."); Console.WriteLine(finishedDrink.GetName()); return(finishedDrink); }
public virtual string GetName() { return(DecoratedBeverage.GetName()); }
public string GetName() => $"{beverage.GetName()}, {this.GetType().Name}";