using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Model { /// /// Quantity is a class which is associate to Ingedients. It represents the quantity of every ingredient with an enum /// to indicate the unit of the quantity. /// public class Quantity { #region Attributes /// /// get the quatity of ingredient /// private int number; /// /// have the Unit enum of the quantity of ingredient /// private Unit unit; #endregion /// /// Represents the quantity in digits. The null value raise an argumentException. /// public int Number { get { return number; } set { if (value < 0) { throw new ArgumentException("Si la quantité est inférieur à 0, enlever l'ingrédient!"); } number = value; } } public Unit UnitQ { get => unit; set => unit = value; } #region Constructor /// /// Constructor of Quantity /// /// /// public Quantity(int number, Unit unit) { Number = number; UnitQ = unit; } #endregion } }