Ajout de la cover dans la classe Game

Popup_qui_marche_pas
Anthony RICHARD 2 years ago
parent 9891dc026e
commit ad39b8069e

@ -14,7 +14,7 @@ namespace Model
get { return name; }
private set
{
if (value == null || value == "") return;
if (value == null || string.IsNullOrWhiteSpace(value)) return;
name = value;
}
}
@ -25,7 +25,7 @@ namespace Model
get { return description; }
private set
{
if (value == null || value == "") return;
if (value == null || string.IsNullOrWhiteSpace(value)) return;
description = value;
}
}
@ -42,6 +42,17 @@ namespace Model
}
private int year;
public string Cover
{
get => cover;
set
{
if (value == null || string.IsNullOrWhiteSpace(value)) return;
cover = value;
}
}
private string cover;
public string[] Tags
{
get => tags;
@ -57,13 +68,14 @@ namespace Model
public List<Review> Reviews { get; private init; }
public Game(string name, string description, int year, string[] tags)
public Game(string name, string description, int year, string[] tags, string cover)
{
Name = name;
Description = description;
Year = year;
tags = new string[3];
Tags = tags;
Cover= cover;
Reviews = new List<Review>();
}

@ -15,9 +15,10 @@ namespace Model
public Manager(IPersistance persistance)
{
_persistance = persistance;
Games.Add(new("test", "description", 2010, new string[3] { "1", "2", "3" }));
Games.Add(new("test2", "description", 2010, new string[3] { "1", "2", "3" }));
Games.Add(new("test2", "description", 2010, new string[3] { "1", "2", "3" }));
Games.Add(new("Elden Ring", "description", 2010, new string[3] { "1", "2", "3" }, "elden_ring.jpg"));
Games.Add(new("Minecraft", "description", 2010, new string[3] { "1", "2", "3" }, "minecraft.jpeg"));
Games.Add(new("Celeste", "description", 2010, new string[3] { "1", "2", "3" }, "celeste.png"));
Games.Add(new("GTA V", "description", 2010, new string[3] { "1", "2", "3" }, "gta_v.png"));
}
}
}

Loading…
Cancel
Save