diff --git a/Core/Account.cs b/Core/Account.cs index 20dffe9..23990fe 100644 --- a/Core/Account.cs +++ b/Core/Account.cs @@ -1,4 +1,5 @@ -using System; +using ShoopNCook.Pages; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -11,6 +12,8 @@ namespace ShoopNCook.Core private readonly User user; private readonly string email; + private List favoriteRecipes; + public Account(User user, string email) { this.user = user; @@ -19,5 +22,12 @@ namespace ShoopNCook.Core public User User { get => user; } public string Email { get => email; } + + public List Favorites { get => favoriteRecipes; } + + public void AddFavoriteRecipe(RecipeInformation recipe) + { + favoriteRecipes.Add(recipe); + } } } diff --git a/Core/Recipe.cs b/Core/Recipe.cs index 6317af1..478de13 100644 --- a/Core/Recipe.cs +++ b/Core/Recipe.cs @@ -8,39 +8,28 @@ namespace ShoopNCook.Core { internal class Recipe { - private string name; - private string description; - private User owner; - private Uri image; - private float averageNote; - private List ingredients; - private List steps; + private readonly RecipeInformation info; + private readonly User owner; + + private readonly List ingredients; + private readonly List steps; public Recipe( - string name, - string description, + RecipeInformation info, User owner, - Uri image, - float averageNote, List ingredients, List steps) { - this.name = name; - this.description = description; + this.info = info; this.owner = owner; - this.image = image; - this.averageNote = averageNote; this.ingredients = ingredients; this.steps = steps; } - public string Name { get => name; } - public string Description { get => description; } + public RecipeInformation Info { get => info; } public User Owner { get => owner; } - public Uri Image { get => image; } - - public float AverageNote { get => averageNote; } + public List Ingredients { get => ingredients; } public List Steps { get => steps; } } diff --git a/Core/RecipeInformation.cs b/Core/RecipeInformation.cs new file mode 100644 index 0000000..d9673a6 --- /dev/null +++ b/Core/RecipeInformation.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ShoopNCook.Core +{ + internal class RecipeInformation + { + private string name; + private string description; + private Uri image; + private float averageNote; + private int cookTimeMinutes; + private int caloriesPerGuest; + + public RecipeInformation(string name, string description, Uri image, float averageNote, int cookTimeMinutes, int caloriesPerGuest) + { + this.name = name; + this.description = description; + this.image = image; + this.averageNote = averageNote; + this.cookTimeMinutes = cookTimeMinutes; + this.caloriesPerGuest = caloriesPerGuest; + } + + public string Name { get => name; } + public string Description { get => description; } + public Uri Image { get => image; } + public float AverageNote { get => averageNote; } + public int CookTimeMinutes { get => cookTimeMinutes; } + public int CaloriesPerGuest { get => caloriesPerGuest; } + } +}