fix compilation errors

pull/34/head
Maxime BATISTA 2 years ago
parent d556920e4f
commit 83788b942d

@ -1,33 +0,0 @@
using ShoopNCook.Pages;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Account
{
private readonly User user;
private readonly string email;
private List<RecipeInformation> favoriteRecipes;
public Account(User user, string email)
{
this.user = user;
this.email = email;
}
public User User { get => user; }
public string Email { get => email; }
public List<RecipeInformation> Favorites { get => favoriteRecipes; }
public void AddFavoriteRecipe(RecipeInformation recipe)
{
favoriteRecipes.Add(recipe);
}
}
}

@ -1,26 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Ingredient
{
private readonly string name;
private readonly float amount;
private readonly Quantity quantity;
public Ingredient(string name, float amount, Quantity quantity) {
this.name = name;
this.amount = amount;
this.quantity = quantity;
}
public string Name { get => name; }
public float Amount { get => amount; }
public Quantity Quantity { get => quantity;}
}
}

@ -1,24 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class PreparationStep
{
private string name;
private string description;
public PreparationStep(string name, string description)
{
this.name = name;
this.description = description;
}
public string Name { get => name; }
public string Description { get => description; }
}
}

@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Quantity
{
}
}

@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class Recipe
{
private readonly RecipeInformation info;
private readonly User owner;
private readonly List<Ingredient> ingredients;
private readonly List<PreparationStep> steps;
public Recipe(
RecipeInformation info,
User owner,
List<Ingredient> ingredients,
List<PreparationStep> steps)
{
this.info = info;
this.owner = owner;
this.ingredients = ingredients;
this.steps = steps;
}
public RecipeInformation Info { get => info; }
public User Owner { get => owner; }
public List<Ingredient> Ingredients { get => ingredients; }
public List<PreparationStep> Steps { get => steps; }
}
}

@ -1,35 +0,0 @@
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; }
}
}

@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ShoopNCook.Core
{
internal class User
{
private string name;
private Uri profilePicture;
public User(Uri profilePicture, string name)
{
this.profilePicture = profilePicture;
this.name = name;
}
public Uri ProfilePicture { get; }
public string Name { get; }
}
}

@ -0,0 +1,15 @@
namespace ShoopNCook.Models
{
internal class Account
{
public Account(User usr, string mail)
{
User = usr;
Email = mail;
}
public User User { get; init; }
public string Email { get; init; }
}
}

@ -0,0 +1,18 @@

namespace ShoopNCook.Models
{
internal class Ingredient
{
public Ingredient(string name, float amount, Quantity quantity) {
Name = name;
Amount = amount;
Quantity = quantity;
}
public string Name { get; init; }
public float Amount { get; init; }
public Quantity Quantity { get; init; }
}
}

@ -0,0 +1,17 @@

namespace ShoopNCook.Models
{
internal class PreparationStep
{
public PreparationStep(string name, string description)
{
this.Name = name;
this.Description = description;
}
public string Name { get; init; }
public string Description { get; init; }
}
}

@ -0,0 +1,7 @@

namespace ShoopNCook.Models
{
internal class Quantity
{
}
}

@ -0,0 +1,26 @@

namespace ShoopNCook.Models
{
internal class Recipe
{
public RecipeInfo Info { get; init; }
public User Owner { get; init; }
public List<Ingredient> Ingredients { get; init; }
public List<PreparationStep> Steps { get; init; }
public Recipe(
RecipeInfo info,
User owner,
List<Ingredient> ingredients,
List<PreparationStep> steps)
{
Info = info;
Owner = owner;
Ingredients = ingredients;
Steps = steps;
}
}
}

@ -0,0 +1,20 @@

namespace ShoopNCook.Models
{
internal class RecipeInfo
{
public string Name { get; init; }
public string Description { get; init; }
public Uri Image { get; init; }
public float AverageNote { get; init; }
public RecipeInfo(string name, string description, Uri image, float averageNote)
{
Name = name;
Description = description;
Image = image;
AverageNote = averageNote;
}
}
}

@ -0,0 +1,16 @@

namespace ShoopNCook.Models
{
internal class User
{
public User(Uri profilePicture, string name)
{
ProfilePicture = profilePicture;
Name = name;
}
public Uri ProfilePicture { get; init; }
public string Name { get; init; }
}
}
Loading…
Cancel
Save