From 00cbfbfdb23ec0c9a3c19857110496dd700313b9 Mon Sep 17 00:00:00 2001 From: Yoan Date: Thu, 18 May 2023 21:55:35 +0200 Subject: [PATCH] =?UTF-8?q?Navigation=20fonctionnelle=20sur=20toutes=20les?= =?UTF-8?q?=20pages=20d'informations,=20d=C3=A9but=20page=20favoris,=20nou?= =?UTF-8?q?velles=20page=20infos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Model/Bateau.cs | 15 +- Sources/Model/Manager.cs | 24 +++ Sources/Ohara.sln | 2 +- Sources/Ohara/App.xaml.cs | 4 +- Sources/Ohara/AppShell.xaml | 4 +- Sources/Ohara/AppShell.xaml.cs | 6 +- Sources/Ohara/MainPage.xaml | 1 + Sources/Ohara/MainPage.xaml.cs | 17 +- Sources/Ohara/MauiProgram.cs | 8 +- Sources/Ohara/Ohara.csproj | 6 + Sources/Ohara/PageBateau.xaml | 4 +- Sources/Ohara/PageBateau.xaml.cs | 19 +- Sources/Ohara/PageBestiaire.xaml | 7 +- Sources/Ohara/PageBestiaire.xaml.cs | 24 ++- Sources/Ohara/PageCarte.xaml | 2 +- Sources/Ohara/PageCarte.xaml.cs | 15 +- Sources/Ohara/PageEquipage.xaml | 4 +- Sources/Ohara/PageEquipage.xaml.cs | 20 +- Sources/Ohara/PageFDD.xaml | 6 +- Sources/Ohara/PageFDD.xaml.cs | 20 +- Sources/Ohara/PageFavoris.xaml | 94 +++++++++ Sources/Ohara/PageFavoris.xaml.cs | 81 ++++++++ Sources/Ohara/PageIle.xaml | 4 +- Sources/Ohara/PageIle.xaml.cs | 19 +- Sources/Ohara/PageInfoBateau.xaml | 215 ++++++++++----------- Sources/Ohara/PageInfoBateau.xaml.cs | 12 +- Sources/Ohara/PageInfoBestiaire.xaml | 104 +++++----- Sources/Ohara/PageInfoBestiaire.xaml.cs | 15 +- Sources/Ohara/PageInfoEquipage.xaml | 137 ++++++------- Sources/Ohara/PageInfoEquipage.xaml.cs | 17 +- Sources/Ohara/PageInfoFdd.xaml | 160 ++++++++------- Sources/Ohara/PageInfoFdd.xaml.cs | 14 +- Sources/Ohara/PageInfoIle.xaml | 138 ++++++------- Sources/Ohara/PageInfoIle.xaml.cs | 16 +- Sources/Ohara/PageInfoPersonnage.xaml | 182 ++++++++--------- Sources/Ohara/PageInfoPersonnage.xaml.cs | 16 +- Sources/Ohara/PagePersonnage.xaml | 5 +- Sources/Ohara/PagePersonnage.xaml.cs | 24 ++- Sources/Ohara/Resources/Styles/Styles.xaml | 38 ++++ Sources/TestConsole/Program.cs | 10 +- 40 files changed, 875 insertions(+), 634 deletions(-) create mode 100644 Sources/Ohara/PageFavoris.xaml create mode 100644 Sources/Ohara/PageFavoris.xaml.cs diff --git a/Sources/Model/Bateau.cs b/Sources/Model/Bateau.cs index 661a445..fb9eaf0 100644 --- a/Sources/Model/Bateau.cs +++ b/Sources/Model/Bateau.cs @@ -23,12 +23,11 @@ namespace Model public string Description { get; set; } [DataMember(Name = "caracteristique")] public string Caracteristique { get; set; } - - - - public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image ) : base(nom,image) + + + public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique) : base(nom) { - + NomRomanise = nomRomanise; if (premierEp < 0) @@ -49,7 +48,11 @@ namespace Model } Description = description; Caracteristique = caracteristique; - + + } + public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image ) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique) + { + Image = image; } public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique,image) diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs index cef6e1a..e073e6f 100644 --- a/Sources/Model/Manager.cs +++ b/Sources/Model/Manager.cs @@ -84,5 +84,29 @@ namespace Model } return listeFDD; } + + public List GetFavoris() + { + List listeFavoris = new List(); + listeFavoris.AddRange(GetBateaux()); + listeFavoris.AddRange(GetIles()); + listeFavoris.AddRange(GetEquipages()); + listeFavoris.AddRange(GetFruits()); + listeFavoris.AddRange(GetBestiaires()); + listeFavoris.AddRange(GetPersonnages()); + foreach(ObjetOhara obj in listeFavoris.ToList()) + { + if (obj.EstFavori == true) + { + listeFavoris.Remove(obj); + } + } + return listeFavoris; + } + + public void AddFavoris(ObjetOhara obj) + { + obj.EstFavori = true; + } } } diff --git a/Sources/Ohara.sln b/Sources/Ohara.sln index d536ff9..25fd92f 100644 --- a/Sources/Ohara.sln +++ b/Sources/Ohara.sln @@ -9,7 +9,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestConsole", "TestConsole\TestConsole.csproj", "{82A1ED67-9A29-4F12-94CD-2DC8221DE374}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestProject1", "TestProject1\TestProject1.csproj", "{4AD3B218-1007-4859-BC93-2B3E957632E0}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestProject1", "TestProject1\TestProject1.csproj", "{4AD3B218-1007-4859-BC93-2B3E957632E0}" ProjectSection(ProjectDependencies) = postProject {A0307D66-E621-4BC1-A239-87C9021E7CFD} = {A0307D66-E621-4BC1-A239-87C9021E7CFD} EndProjectSection diff --git a/Sources/Ohara/App.xaml.cs b/Sources/Ohara/App.xaml.cs index 9ac759d..a751b57 100644 --- a/Sources/Ohara/App.xaml.cs +++ b/Sources/Ohara/App.xaml.cs @@ -1,4 +1,6 @@ -namespace Ohara; +using Plugin.Maui.Audio; + +namespace Ohara; public partial class App : Application { diff --git a/Sources/Ohara/AppShell.xaml b/Sources/Ohara/AppShell.xaml index 5637476..66dd193 100644 --- a/Sources/Ohara/AppShell.xaml +++ b/Sources/Ohara/AppShell.xaml @@ -13,8 +13,8 @@ + ContentTemplate="{DataTemplate local:MainPage}" + Route="PageInfoPersonnage" /> diff --git a/Sources/Ohara/AppShell.xaml.cs b/Sources/Ohara/AppShell.xaml.cs index d8ecc87..250878a 100644 --- a/Sources/Ohara/AppShell.xaml.cs +++ b/Sources/Ohara/AppShell.xaml.cs @@ -1,9 +1,13 @@ namespace Ohara; +using Model; + public partial class AppShell : Shell { - public AppShell() + + public AppShell() { InitializeComponent(); + } } diff --git a/Sources/Ohara/MainPage.xaml b/Sources/Ohara/MainPage.xaml index ddfd08d..04d3b4f 100644 --- a/Sources/Ohara/MainPage.xaml +++ b/Sources/Ohara/MainPage.xaml @@ -32,6 +32,7 @@