diff --git a/Sources/Stim.Model/Game.cs b/Sources/Stim.Model/Game.cs index fc8e0e8..0fce76e 100644 --- a/Sources/Stim.Model/Game.cs +++ b/Sources/Stim.Model/Game.cs @@ -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 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(); } diff --git a/Sources/Stim.Model/Manager.cs b/Sources/Stim.Model/Manager.cs index d74e375..5e7b919 100644 --- a/Sources/Stim.Model/Manager.cs +++ b/Sources/Stim.Model/Manager.cs @@ -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")); } } }