|
|
@ -12,7 +12,7 @@ namespace Model
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string Name
|
|
|
|
public string Name
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => name;
|
|
|
|
get => name ?? "Default";
|
|
|
|
private set
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) name="Default";
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) name="Default";
|
|
|
@ -23,12 +23,12 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string? name;
|
|
|
|
private string name;
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string? Description
|
|
|
|
public string Description
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => description;
|
|
|
|
get => description ?? "Pas de description";
|
|
|
|
private set
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) return;
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) return;
|
|
|
@ -39,7 +39,7 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string? description;
|
|
|
|
private string description;
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public int Year
|
|
|
|
public int Year
|
|
|
@ -58,9 +58,9 @@ namespace Model
|
|
|
|
private int year;
|
|
|
|
private int year;
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string? Cover
|
|
|
|
public string Cover
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => cover;
|
|
|
|
get => cover ?? "no_cover.png";
|
|
|
|
private set
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) cover="no_cover.png";
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) cover="no_cover.png";
|
|
|
@ -71,7 +71,7 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string? cover;
|
|
|
|
private string cover;
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public ObservableCollection<string> Tags
|
|
|
|
public ObservableCollection<string> Tags
|
|
|
@ -95,13 +95,13 @@ namespace Model
|
|
|
|
public double Average => AverageCalc();
|
|
|
|
public double Average => AverageCalc();
|
|
|
|
public double AverageCalc()
|
|
|
|
public double AverageCalc()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (Reviews.Count > 0) return Math.Round((double)Reviews.Select(review => review.Rate).Average(), 1); // FAUT FIX POUR QUAND Y'A PAS DE REVIEWS
|
|
|
|
if (Reviews.Count > 0) return Math.Round((double)Reviews.Select(review => review.Rate).Average(), 1);
|
|
|
|
else return 0;
|
|
|
|
else return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[DataMember]
|
|
|
|
[DataMember]
|
|
|
|
public string? Lien {
|
|
|
|
public string Lien {
|
|
|
|
get => lien;
|
|
|
|
get => lien ?? "Pas de lien";
|
|
|
|
private set
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) return;
|
|
|
|
if (string.IsNullOrWhiteSpace(value)) return;
|
|
|
@ -112,20 +112,20 @@ namespace Model
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
private string? lien;
|
|
|
|
private string lien;
|
|
|
|
|
|
|
|
|
|
|
|
public Game(string name, string description, int year, List<string> c_tags, string cover, string c_lien)
|
|
|
|
public Game(string name, string description, int year, List<string> c_tags, string cover, string c_lien)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.IsNullOrWhiteSpace(name)) Name = "Default";
|
|
|
|
if (string.IsNullOrWhiteSpace(name)) Name = "Default";
|
|
|
|
else Name = name;
|
|
|
|
else Name = name;
|
|
|
|
if (string.IsNullOrWhiteSpace(description)) Description = "Default";
|
|
|
|
if (string.IsNullOrWhiteSpace(description)) Description = "Pas de description";
|
|
|
|
else Description = description;
|
|
|
|
else Description = description;
|
|
|
|
Year = year;
|
|
|
|
Year = year;
|
|
|
|
if (c_tags is not null) tags = new ObservableCollection<string>(c_tags);
|
|
|
|
if (c_tags is not null) tags = new ObservableCollection<string>(c_tags);
|
|
|
|
else tags = new ObservableCollection<string>();
|
|
|
|
else tags = new ObservableCollection<string>();
|
|
|
|
if (string.IsNullOrWhiteSpace(cover)) Cover = "no_cover.png";
|
|
|
|
if (string.IsNullOrWhiteSpace(cover)) Cover = "no_cover.png";
|
|
|
|
else Cover = cover;
|
|
|
|
else Cover = cover;
|
|
|
|
if (string.IsNullOrWhiteSpace(c_lien)) Lien = "Default";
|
|
|
|
if (string.IsNullOrWhiteSpace(c_lien)) Lien = "Pas de lien";
|
|
|
|
else Lien = c_lien;
|
|
|
|
else Lien = c_lien;
|
|
|
|
Reviews = new List<Review>();
|
|
|
|
Reviews = new List<Review>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|