public static void Main(string[] args) { Beverage[] beverages = new Beverage[2]; Beverage jolt = new Beverage("jolt", 12.0, 0.25); beverages[0] = jolt; Beverage coke = new Beverage("coca-cola", 12.0, .0125); beverages[1] = coke; foreach (Beverage beverage in beverages) { Console.WriteLine(beverage); } }
public Whip(Beverage beverage) { this.beverage = beverage; Description = beverage.GetDescription() + ", Whip"; }
public Mocha(Beverage beverage) { _beverage = beverage; }
public Addon(Beverage beverage, string name, decimal cost) { _cost = cost; _name = name; _beverage = beverage; }
/// <summary> /// 构造函数,传入要装饰的对象 /// </summary> /// <param name="beverage"></param> public Milk(Beverage.Beverage beverage) { this.beverage = beverage; }
public Mocha(Beverage beverage) { _beverage = beverage; }
public Whip(Beverage beverage) { this.beverage = beverage; }
public SteamedMilk(Beverage beverage) { this.beverage = beverage; }
// PUT: api/Beverages/5 public void Put(int id, [FromBody] Beverage beverage) //Aslında gerek yok, order kısmında özellikle izin vermedim. { _beverages.Remove(_beverages.Find(x => x.Id == id)); _beverages.Add(beverage); }
// POST: api/Beverages public void Post([FromBody] Beverage beverage) { _beverages.Add(beverage); }
public CondimentDecorator(string description, float cost, Beverage beverage) : base(description, cost, beverage.Size) { Beverage = beverage; }
public Caramel(Beverage beverage) : base(beverage, "Caramel", 1M) { }
public Soy(Beverage beverage) => this.beverage = beverage;
public Milk(Beverage beverage) { Beverage = beverage; }
public Whip(Beverage beverage) { _beverage = beverage; }
public Mocha(Beverage beverage) { _beverage = beverage; Size = _beverage.GetSize(); }
public MochaCondiment(Beverage beverage) { this._beverage = beverage; }
public Milk(Beverage beverage) : base(beverage) { }
public Mocha(Beverage b) : base(b) { _beverage = b; }
public Mocha(Beverage beverage) : base(beverage) { }
private void AssertDescriptionContains(Beverage drink, string term, string context) { Assert.IsTrue(drink.Description.Contains(term), $"Description does not include {context}: '{term}'"); }
public Whip(Beverage beverage) : base(beverage) { }
public Milk(Beverage ver) { m_Beverage = ver; }
public Honey(Beverage beverage, int price) { this.beverage = beverage; Price = price; }
public Mocha(Beverage beverage) { this.beverage = beverage; }
public SteamedMilk(Beverage beverage) { this.beverage = beverage; }
public Soy(Beverage beverage) { this.beverage = beverage; }
public Soy(Beverage beverage) { _beverage = beverage; }
public BeverageDecorator(Beverage b) { }
public Mocha(Beverage beverage) { _beverage = beverage; _description = "Mocha "; }
public CondimentDecorator(Beverage beverage) { this.beverage = beverage; }
public Mocha(Beverage beverage) { this.beverage = beverage; description = beverage.getDescription() + ", Mocha"; }
//select a drink from grid view private void GridView_ItemClick(object sender, ItemClickEventArgs e) => _selected = e.ClickedItem as Beverage;
protected Milk(Beverage beverage) { this.beverage = beverage; }
public Whip(Beverage beverage) { this.beverage = beverage; }
protected CondimentDecorator(Beverage beverage) { this.beverage = beverage; }
public string RemoveFromMenu(Beverage beverage) { VendingMachine.RemoveBeverage(beverage); return($"Removed {beverage} from the menu"); }
public StemeadMilk(Beverage beverage) { this.beverage = beverage; }
public Whip(Beverage beverage) => this.beverage = beverage;
public Soy(Beverage beverage) : base(beverage) { }
public Soy(Beverage beverage) : base(beverage) { }
public Whip(Beverage beverage) { _beverage = beverage; }
public SteamedMilk(Beverage beverage) { this.beverage = beverage; description = beverage.getDescription() + ", SteamedMilk"; }
public Soy(Beverage beverage) { this.beverage = beverage; }
public Mocha(Beverage beverage) => _beverage = beverage;
public MilkWholeDecorator(Beverage b) : base(b) { }
public Milk(Beverage beverage) { _beverage = beverage; }
/// <summary> /// Maneira de definir a variável para o objeto que estamos englobando /// </summary> /// <param name="beverage"></param> public Mocha(Beverage beverage) { this._beverage = beverage; }
public DrinkOrder(Beverage beverage) { Id = NextId++; Created = System.DateTime.UtcNow; Beverage = beverage; }