/// <summary> /// Private constructor for cloning purpose. /// </summary> /// <param name="name">Name of the meal</param> /// <param name="cost">Cost of the meal</param> /// <param name="currency">Currency of the cost</param> /// <param name="type">Type of the meal (pizza, soup, etc.)</param> /// <param name="availableAdditives">A collection of available additives for the meal</param> /// <param name="availableMandatoryAdditives">A collection of available additives for the meal from which one must be added to the meal (rice, potatoes, etc.)</param> /// <param name="selectedAdditives">A collection of selected additives</param> private Meal(string name, decimal cost, string currency, MealType type, IEnumerable <Additive> availableAdditives, IEnumerable <Additive> availableMandatoryAdditives, IAdditiveCollection selectedAdditives) { this.Name = name; this.Cost = cost; this.Currency = currency; this.Type = type; this.availableAdditives = availableAdditives; this.availableMandatoryAdditives = availableMandatoryAdditives; this.SelectedAdditives = selectedAdditives; }
/// <summary> /// Creates a Meal object. Sets Currency field as default value: "zł". /// </summary> /// <param name="name">Name of the meal</param> /// <param name="cost">Cost of the meal</param> /// <param name="type">Type of the meal (pizza, soup, etc.)</param> /// <param name="availableAdditivesFactory">Object which creates a collection of available additives for the meal</param> /// <param name="availableMandatoryAdditivesFactory">Object which creates a collection of available additives for the meal from which one must be added to the meal (rice, potatoes, etc.)</param> /// <param name="additiveCollection">A collection to which selected additives are added</param> public Meal(string name, decimal cost, MealType type, IAdditiveFactory availableAdditivesFactory, IAdditiveFactory availableMandatoryAdditivesFactory, IAdditiveCollection additiveCollection) : this(name, cost, "zł", type, availableAdditivesFactory, availableMandatoryAdditivesFactory, additiveCollection) { }