public string Order(Order order) { Drink drink = DrinkFactory.Create(order.Boisson); if (IsEnoughMoney(drink, order.Money)) { _report.Add(order.Boisson); return(BuildCommand(drink, order.Sugar, order.Hot)); } else { return(Message("Not enough money")); } }
public double CA() { return((from i in _dictionary let drink = DrinkFactory.Create(i.Key) select i.Value *drink.Price).Sum()); }