diff --git a/GameAtlas/GameAtlas/Models/Jeu.cs b/GameAtlas/GameAtlas/Models/Jeu.cs index 723b2d1..9701436 100644 --- a/GameAtlas/GameAtlas/Models/Jeu.cs +++ b/GameAtlas/GameAtlas/Models/Jeu.cs @@ -21,7 +21,7 @@ namespace GameAtlas.Models [DataMember] public string Editeur { get; private set; } [DataMember] - public int Note { get; private set; } + public double Note { get; private set; } [DataMember] public int NbTelechargement { get; private set; } //[DataMember] @@ -31,7 +31,7 @@ namespace GameAtlas.Models [DataMember] public string Image { get; private set; } - public Jeu(string nom, string sortie, string plateformes, string developpeur, string editeur, int note, int nbTelechargement, string genres, string image) + public Jeu(string nom, string sortie, string plateformes, string developpeur, string editeur, double note, int nbTelechargement, string genres, string image) { Nom = nom; Sortie = sortie; diff --git a/GameAtlas/GameAtlas/Stub/Stub.cs b/GameAtlas/GameAtlas/Stub/Stub.cs index a4f333e..4ed4714 100644 --- a/GameAtlas/GameAtlas/Stub/Stub.cs +++ b/GameAtlas/GameAtlas/Stub/Stub.cs @@ -21,13 +21,13 @@ namespace GameAtlas.Stub ListUsers.Add(userTest); ListAdmins.Add(admin); - Jeu TheLastOfUs = new Jeu("The Last Of Us Part I", "28 Mars 2023", "PS5 PC", "Naughty Dog LLC", "Naughty Dog LLC", 5, 487, "Solo Action Aventure", "cover_lastofus1.png"); - Jeu ForzaHorizon = new Jeu("Forza Horizon 5", "9 Novembre 2021", "PC XOne", "Playground Games", "Xbox Game Studios", 4, 420, "Course Simulation Sport", "cover_forzahorizon5.png"); - Jeu TOTK = new Jeu("The Legend of Zelda: Tears of the Kingdom", "12 Mai 2023", "Switch", "Nintendo", "Nintendo", 5, 250, "Action Aventure", "cover_zelda.png"); - Jeu ReadyOrNot = new Jeu("Ready or Not", "18 décembre 2021", "PC", "VOID Interactive", "VOID Interactive", 5, 100, "Solo Action Aventure", "cover_readyornot.png"); - Jeu Hogwarts = new Jeu("Hogwarts Legacy : L'Héritage de Poudlard", "10 février 2023", "PC Switch XOne", "Avalanche Software", "Warner Bros. Games", 5, 100, "Solo Action Aventure RPG", "cover_hogwarts.png"); - Jeu RE4 = new Jeu("Resident Evil 4", "24 mars 2023", "PC XSeries", "CAPCOM Co., Ltd.", "CAPCOM Co., Ltd.", 5, 100, "Solo Action Aventure", "cover_residentevil4.png"); - Jeu JediSurvivor = new Jeu("Star Wars Jedi: Survivor", "28 avril 2023", "PC XSeries", "Respawn", "Electronic Arts", 5, 100, "Solo Action Aventure", "cover_starwarsjedisurvivor.png"); + Jeu TheLastOfUs = new Jeu("The Last Of Us Part I", "28 Mars 2023", "PS5 PC", "Naughty Dog LLC", "PlayStation PC LLC", 8.5, 487, "Solo Action Aventure", "cover_lastofus1.png"); + Jeu ForzaHorizon = new Jeu("Forza Horizon 5", "9 Novembre 2021", "PC XOne", "Playground Games", "Xbox Game Studios", 6.5, 420, "Course Simulation Sport", "cover_forzahorizon5.png"); + Jeu TOTK = new Jeu("The Legend of Zelda: Tears of the Kingdom", "12 Mai 2023", "Switch", "Nintendo", "Nintendo", 10, 250, "Action Aventure", "cover_zelda.png"); + Jeu ReadyOrNot = new Jeu("Ready or Not", "18 Décembre 2021", "PC", "VOID Interactive", "VOID Interactive", 7, 100, "Solo Action Aventure", "cover_readyornot.png"); + Jeu Hogwarts = new Jeu("Hogwarts Legacy : L'Héritage de Poudlard", "10 Février 2023", "PC Switch XOne", "Avalanche Software", "Warner Bros. Games", 5, 100, "Solo Action Aventure RPG", "cover_hogwarts.png"); + Jeu RE4 = new Jeu("Resident Evil 4", "24 Mars 2023", "PC XSeries", "CAPCOM Co., Ltd.", "CAPCOM Co., Ltd.", 8, 100, "Solo Action Aventure", "cover_residentevil4.png"); + Jeu JediSurvivor = new Jeu("Star Wars Jedi: Survivor", "28 Avril 2023", "PC XSeries", "Respawn", "Electronic Arts", 5.5, 100, "Solo Action Aventure", "cover_starwarsjedisurvivor.png"); ListJeu.Add(TheLastOfUs); ListJeu.Add(ForzaHorizon); ListJeu.Add(TOTK); diff --git a/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs b/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs index 4fb44e3..f612fbc 100644 --- a/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs +++ b/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs @@ -122,7 +122,7 @@ public partial class PageAdmin : ContentPage if (!annuler) { - Jeu adminJeu = new Jeu(nom, sortie, plateformes, developpeur, editeur, Convert.ToInt32(note), Convert.ToInt32(nbTelechargement), genre, image); + Jeu adminJeu = new Jeu(nom, sortie, plateformes, developpeur, editeur, Convert.ToDouble(note), Convert.ToInt32(nbTelechargement), genre, image); AdminManager.AddJeux(adminJeu); AdminManager.SauvegardeDonnees(); AdminManager.OnPropertyChanged(nameof(AdminManager.ListJeux));