From 5a97193d4bd89c767370b00798270f55c94b383d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoan=20BRUGI=C3=88RE?= Date: Sat, 13 May 2023 12:05:25 +0200 Subject: [PATCH] Rajout EstFavori --- Sources/Model/Bateau.cs | 2 +- Sources/Model/Bestiaire.cs | 10 ++++++++-- Sources/Model/Equipage.cs | 11 ++++++++++- Sources/Model/FruitDuDemon.cs | 10 ++++++++-- Sources/Model/Ile.cs | 10 ++++++++-- Sources/Model/ObjetOhara.cs | 6 +++++- Sources/Model/Personnage.cs | 7 ++++++- Sources/Ohara/AppShell.xaml | 4 ++-- Sources/Ohara/MauiProgram.cs | 4 +++- Sources/Ohara/PageBateau.xaml | 2 ++ Sources/Ohara/PageBateau.xaml.cs | 7 +++++++ Sources/Ohara/PageBestiaire.xaml | 1 + Sources/Ohara/PageBestiaire.xaml.cs | 6 ++++++ Sources/Ohara/PageCarte.xaml | 1 + Sources/Ohara/PageCarte.xaml.cs | 6 ++++++ Sources/Ohara/PageEquipage.xaml | 1 + Sources/Ohara/PageEquipage.xaml.cs | 11 ++++++----- Sources/Ohara/PageFDD.xaml | 3 ++- Sources/Ohara/PageFDD.xaml.cs | 9 ++++++--- Sources/Ohara/PageIle.xaml | 1 + Sources/Ohara/PageIle.xaml.cs | 12 ++++++++---- Sources/Ohara/PagePersonnage.xaml | 2 ++ Sources/Ohara/PagePersonnage.xaml.cs | 9 ++++++++- Sources/TestConsole/Program.cs | 17 +++++++++++++++-- 24 files changed, 123 insertions(+), 29 deletions(-) diff --git a/Sources/Model/Bateau.cs b/Sources/Model/Bateau.cs index dd718ac..661a445 100644 --- a/Sources/Model/Bateau.cs +++ b/Sources/Model/Bateau.cs @@ -26,7 +26,7 @@ namespace Model - public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image = "baseimage.png") : base(nom,image) + public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image ) : base(nom,image) { NomRomanise = nomRomanise; diff --git a/Sources/Model/Bestiaire.cs b/Sources/Model/Bestiaire.cs index 2ca8d77..704a7a8 100644 --- a/Sources/Model/Bestiaire.cs +++ b/Sources/Model/Bestiaire.cs @@ -18,15 +18,21 @@ namespace Model public string Description { get; set; } [DataMember(Name = "caracteristique")] public string Caracteristique { get; set; } - - public Bestiaire(string nom, string origine, string description, string caracteristique,string image = "baseimage.png") : base(nom, image) + + + public Bestiaire(string nom, string origine, string description, string caracteristique) : base(nom) { Origine = origine; Description = description; Caracteristique = caracteristique; } + public Bestiaire(string nom, string origine, string description, string caracteristique,string image ) : this(nom,origine,description,caracteristique) + { + Image=image; + } + } } diff --git a/Sources/Model/Equipage.cs b/Sources/Model/Equipage.cs index 9d047bb..c3328f6 100644 --- a/Sources/Model/Equipage.cs +++ b/Sources/Model/Equipage.cs @@ -31,7 +31,7 @@ namespace Model public List Allie { get; set; } = new List(); - public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description,string image = "baseimage.png") : base(nom,image) + public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description) : base(nom) { NomRomanise = nomRomanise; @@ -56,5 +56,14 @@ namespace Model Description = description; } + + public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description, string image) : this(nom, nomRomanise,region,premierChap,premierEp,statut,description) + { + + Image = image; + + } + + } } diff --git a/Sources/Model/FruitDuDemon.cs b/Sources/Model/FruitDuDemon.cs index 3ca5ccb..691d34d 100644 --- a/Sources/Model/FruitDuDemon.cs +++ b/Sources/Model/FruitDuDemon.cs @@ -30,7 +30,7 @@ namespace Model - public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image = "baseimage.png") : base(nom,image) + public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses) : base(nom) { NomRomanise = nomRomanise; @@ -55,7 +55,13 @@ namespace Model Forces = forces; Faiblesses = faiblesses; } - + + public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image) : this(nom, nomRomanise,type,premierChap,premierEp,description,forces,faiblesses) + { + + Image = image; + } + public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image, List utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses, image) { Utilisateur = utilisateur; diff --git a/Sources/Model/Ile.cs b/Sources/Model/Ile.cs index cb23bab..e6ffee2 100644 --- a/Sources/Model/Ile.cs +++ b/Sources/Model/Ile.cs @@ -26,7 +26,7 @@ namespace Model - public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image = "baseimage.png") : base(nom,image) + public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie) : base(nom) { NomRomanise = nomRomanise; @@ -50,6 +50,12 @@ namespace Model Description = description; Geographie = geographie; - } + } + + public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) : this(nom,nomRomanise,region,premierChap,premierEp,description,geographie) + { + + Image = image; + } } } diff --git a/Sources/Model/ObjetOhara.cs b/Sources/Model/ObjetOhara.cs index c98807c..31a4d3e 100644 --- a/Sources/Model/ObjetOhara.cs +++ b/Sources/Model/ObjetOhara.cs @@ -15,9 +15,13 @@ namespace Model [DataMember (Name ="image")] public string? Image { get; set;} - public ObjetOhara(string nom,string image) { + public bool EstFavori { get; set; } + + public ObjetOhara(string nom,string image = "baseimage.png", bool estFavori = false) + { Nom = nom; Image = image; + EstFavori = estFavori; } } } diff --git a/Sources/Model/Personnage.cs b/Sources/Model/Personnage.cs index 1eb7009..fc720a1 100644 --- a/Sources/Model/Personnage.cs +++ b/Sources/Model/Personnage.cs @@ -27,7 +27,7 @@ namespace Model - public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image = "baseimage.png") : base(nom,image) + public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation) : base(nom) { if(prime < 0) { @@ -54,6 +54,11 @@ namespace Model } + + public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image) : this(nom, prime,epithete,age,taille,origine,biographie,citation) + { + Image = image; + } public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image) { Equipage = equipage; diff --git a/Sources/Ohara/AppShell.xaml b/Sources/Ohara/AppShell.xaml index b3588da..5637476 100644 --- a/Sources/Ohara/AppShell.xaml +++ b/Sources/Ohara/AppShell.xaml @@ -13,8 +13,8 @@ + ContentTemplate="{DataTemplate local:PagePersonnage}" + Route="PageFDD" /> diff --git a/Sources/Ohara/MauiProgram.cs b/Sources/Ohara/MauiProgram.cs index 8e2f0f3..56566aa 100644 --- a/Sources/Ohara/MauiProgram.cs +++ b/Sources/Ohara/MauiProgram.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using Plugin.Maui.Audio; namespace Ohara; @@ -14,7 +15,8 @@ public static class MauiProgram fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); }); - + builder.Services.AddSingleton(AudioManager.Current); + builder.Services.AddTransient(); #if DEBUG builder.Logging.AddDebug(); #endif diff --git a/Sources/Ohara/PageBateau.xaml b/Sources/Ohara/PageBateau.xaml index f6ab739..3200eb3 100644 --- a/Sources/Ohara/PageBateau.xaml +++ b/Sources/Ohara/PageBateau.xaml @@ -31,6 +31,8 @@