diff --git a/GameAtlas/GameAtlas/AppShell.xaml.cs b/GameAtlas/GameAtlas/AppShell.xaml.cs index ae9ad77..c4859aa 100644 --- a/GameAtlas/GameAtlas/AppShell.xaml.cs +++ b/GameAtlas/GameAtlas/AppShell.xaml.cs @@ -11,5 +11,7 @@ public partial class AppShell : Shell Routing.RegisterRoute(nameof(PageJeu), typeof(PageJeu)); Routing.RegisterRoute(nameof(PageAdmin), typeof(PageAdmin)); + + Routing.RegisterRoute(nameof(PageAcceuil), typeof(PageAcceuil)); } } diff --git a/GameAtlas/GameAtlas/Models/Jeu.cs b/GameAtlas/GameAtlas/Models/Jeu.cs index a244d7a..8e9c36f 100644 --- a/GameAtlas/GameAtlas/Models/Jeu.cs +++ b/GameAtlas/GameAtlas/Models/Jeu.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Linq; using System.Runtime.Serialization; using System.Text; @@ -33,7 +34,7 @@ namespace GameAtlas.Models [DataMember] public string Image { get; private set; } [DataMember] - public List<(string, int, string)> ListeAvis { get; private set; } + public ObservableCollection<(string,double,string)> ListeAvis { get; private set; } [DataMember] public int NbFavoris { get; private set; } [DataMember] @@ -52,11 +53,16 @@ namespace GameAtlas.Models //Revendeurs = revendeurs; Genres = genres; Image = image; - ListeAvis = new List<(string, int, string)>(); + ListeAvis = new ObservableCollection<(string, double, string)>(); NbFavoris = 0; NbPossedes = 0; } + public void AjouterAvis(string pseudo, double note, string commentaire) + { + this.ListeAvis.Add((pseudo, note, commentaire)); + } + public override bool Equals(object obj) { if (obj == null || GetType() != obj.GetType()) diff --git a/GameAtlas/GameAtlas/Models/Manager.cs b/GameAtlas/GameAtlas/Models/Manager.cs index 906ef91..ca7ffad 100644 --- a/GameAtlas/GameAtlas/Models/Manager.cs +++ b/GameAtlas/GameAtlas/Models/Manager.cs @@ -16,7 +16,6 @@ namespace GameAtlas.Models public List Utilisateurs { get; private set; } private ObservableCollection topRatedGames; - public ObservableCollection TopRatedGames { get @@ -44,9 +43,6 @@ namespace GameAtlas.Models OnPropertyChanged(); } } - - - private ObservableCollection listJeux; public ObservableCollection ListJeux diff --git a/GameAtlas/GameAtlas/Resources/Images/logout.png b/GameAtlas/GameAtlas/Resources/Images/logout.png new file mode 100644 index 0000000..6dbd580 Binary files /dev/null and b/GameAtlas/GameAtlas/Resources/Images/logout.png differ diff --git a/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs b/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs index ae408ba..ffebc0f 100644 --- a/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs +++ b/GameAtlas/GameAtlas/Views/PageAdmin.xaml.cs @@ -61,64 +61,64 @@ public partial class PageAdmin : ContentPage } break; case 2: - sortie = await DisplayPromptAsync("Informations sur le Jeu [2/10]", "Date de Sortie", accept: "Suivant", cancel: "Annuler", placeholder: "JJ/MM/AAAA"); - if (string.IsNullOrEmpty(sortie)) + resume = await DisplayPromptAsync("Informations sur le Jeu [2/10]", "Résumé du jeu", accept: "Terminer", cancel: "Annuler", placeholder: "Résumé du jeu"); + if (string.IsNullOrEmpty(resume)) { annuler = true; } break; case 3: - plateformes = await DisplayPromptAsync("Informations sur le Jeu [3/10]", "Plateforme(s), un espace pour séparer", accept: "Suivant", cancel: "Annuler", placeholder: "Ex: XOne PC PS5"); - if (string.IsNullOrEmpty(plateformes)) + sortie = await DisplayPromptAsync("Informations sur le Jeu [3/10]", "Date de Sortie", accept: "Suivant", cancel: "Annuler", placeholder: "JJ/MM/AAAA"); + if (string.IsNullOrEmpty(sortie)) { annuler = true; } break; case 4: - developpeur = await DisplayPromptAsync("Informations sur le Jeu [4/10]", "Développeur", accept: "Suivant", cancel: "Annuler", placeholder: "Rockstar Games"); - if (string.IsNullOrEmpty(developpeur)) + plateformes = await DisplayPromptAsync("Informations sur le Jeu [4/10]", "Plateforme(s), un espace pour séparer", accept: "Suivant", cancel: "Annuler", placeholder: "Ex: XOne PC PS5"); + if (string.IsNullOrEmpty(plateformes)) { annuler = true; } break; case 5: - editeur = await DisplayPromptAsync("Informations sur le Jeu [5/10]", "Editeur", accept: "Suivant", cancel: "Annuler", placeholder: "Take-Two Interactive"); - if (string.IsNullOrEmpty(editeur)) + developpeur = await DisplayPromptAsync("Informations sur le Jeu [5/10]", "Développeur", accept: "Suivant", cancel: "Annuler", placeholder: "Rockstar Games"); + if (string.IsNullOrEmpty(developpeur)) { annuler = true; } break; case 6: - note = await DisplayPromptAsync("Informations sur le Jeu [6/10]", "Note de 0 à 5", accept: "Suivant", cancel: "Annuler", maxLength: 1, placeholder: "5"); - if (string.IsNullOrEmpty(note)) + editeur = await DisplayPromptAsync("Informations sur le Jeu [6/10]", "Editeur", accept: "Suivant", cancel: "Annuler", placeholder: "Take-Two Interactive"); + if (string.IsNullOrEmpty(editeur)) { annuler = true; } break; case 7: - nbTelechargement = await DisplayPromptAsync("Informations sur le Jeu [7/10]", "Nombre de Téléchargements (en milliers, ex: 630k)", accept: "Suivant", cancel: "Annuler", placeholder: "630"); - if (string.IsNullOrEmpty(nbTelechargement)) + note = await DisplayPromptAsync("Informations sur le Jeu [7/10]", "Note de 0 à 10", accept: "Suivant", cancel: "Annuler", maxLength: 3, placeholder: "4,5"); + if (string.IsNullOrEmpty(note)) { annuler = true; } break; case 8: - genre = await DisplayPromptAsync("Informations sur le Jeu [8/10]", "Genre(s), un espace pour séparer", accept: "Suivant", cancel: "Annuler", placeholder: "Action Aventure"); - if (string.IsNullOrEmpty(genre)) + nbTelechargement = await DisplayPromptAsync("Informations sur le Jeu [8/10]", "Nombre de Téléchargements (en milliers, ex: 630k)", accept: "Suivant", cancel: "Annuler", placeholder: "630"); + if (string.IsNullOrEmpty(nbTelechargement)) { annuler = true; } break; case 9: - image = await DisplayPromptAsync("Informations sur le Jeu [9/10]", "Image de couverture (préférez URL finissant par .png)", accept: "Terminer", cancel: "Annuler", placeholder: "http://example.com/monimage.png"); - if (string.IsNullOrEmpty(image)) + genre = await DisplayPromptAsync("Informations sur le Jeu [9/10]", "Genre(s), un espace pour séparer", accept: "Suivant", cancel: "Annuler", placeholder: "Action Aventure"); + if (string.IsNullOrEmpty(genre)) { annuler = true; } - break; + break; case 10: - resume = await DisplayPromptAsync("Informations sur le Jeu [10/10]", "Résumé du jeu", accept: "Terminer", cancel: "Annuler", placeholder: "Résumé du jeu"); - if (string.IsNullOrEmpty(resume)) + image = await DisplayPromptAsync("Informations sur le Jeu [10/10]", "Image de couverture (préférez URL finissant par .png)", accept: "Terminer", cancel: "Annuler", placeholder: "http://example.com/monimage.png"); + if (string.IsNullOrEmpty(image)) { annuler = true; } @@ -130,7 +130,7 @@ public partial class PageAdmin : ContentPage if (!annuler) { - Jeu adminJeu = new Jeu(nom, sortie, plateformes, developpeur, editeur, Convert.ToDouble(note), Convert.ToInt32(nbTelechargement), genre, image); + Jeu adminJeu = new Jeu(nom, resume, sortie, plateformes, developpeur, editeur, Convert.ToDouble(note), Convert.ToInt32(nbTelechargement), genre, image); AdminManager.AddJeux(adminJeu); AdminManager.SauvegardeDonnees(); AdminManager.OnPropertyChanged(nameof(AdminManager.ListJeux)); diff --git a/GameAtlas/GameAtlas/Views/PageJeu.xaml b/GameAtlas/GameAtlas/Views/PageJeu.xaml index 0813ad3..866cf40 100644 --- a/GameAtlas/GameAtlas/Views/PageJeu.xaml +++ b/GameAtlas/GameAtlas/Views/PageJeu.xaml @@ -149,17 +149,9 @@