using System; using System.Collections.Generic; namespace Model { /// /// A Recipe is a description of step and maybe some techniques, with an ingredient list to make a meal.
/// It is instantiated with a new unique four digit id, where the first one is 1. ///
public class Recipe : BaseItem { /// /// This static atrribute stand for the creation of a new id. It is incremented each time a new Recipe is instantiated. /// public static uint idIterator = 0; /// /// The title of the recipe. /// public string Title { get; set; } /// /// All the details about the preparation of the meal. /// public string Preparation { get; set; } public Recipe(string description = "", string title = "", string preparation = "") : base(idIterator+1000, description) { if (idIterator == 1000) throw new OverflowException("id has reach the maximum value."); Title = title; Preparation = preparation; idIterator++; } public override string ToString() { return $"[ Class -Recipe- ]\n\n" + $"\t.Id - {Id}\n" + $"\t.Description - {Description}\n" + $"______\n\n"; } } }