merge
continuous-integration/drone/push Build was killed Details

devGuillaume
Guillaume 2 years ago
commit 96474b0e3a

@ -1,80 +1,649 @@
# Ohara_MAUI
```mermaid
classDiagram
class Bateau{
+ NomRomanise : string
+ PremierChap : int
+ PremierEp : int
+ Description : string
+ Caracteristique : string
}
class Bestiaire {
+ Origine : string
+ Description : string
+ Caracteristique : string
}
class Equipage {
+ NomRomanise : string
+ Region : string
+ PremierChap : int
+ PremierEp : int
+ Statut : bool
+ Description : string
}
class FruitDuDemon {
+ NomRomanise : string
+ Type : string
+ PremierChap : int
+ PremierEp : int
+ Description : string
+ Forces : string
+ Faiblesses : string
}
class Ile {
+ NomRomanise : string
+ Region : string
+ PremierChap : int
+ PremierEp : int
+ Description : string
+ Geographie : string
}
class Personnage {
+ Prime : double
+ Epithete : string
+ Age : int
+ Taille : double
+ Origine : string
+ Biographie : string
+ Citation : string
}
class ObjetOhara {
+ Nom : string
+ Image : string?
}
FruitDuDemon --> Personnage : + Utilisateur
Personnage --> Equipage : + Equipage
Personnage --> FruitDuDemon : + Fruit
Bateau --> Equipage : + Affiliation
Equipage --> Personnage : + Capitaine
Equipage --> Personnage : + Membre
Equipage --> Equipage : + Allie
Ile --|> ObjetOhara
FruitDuDemon --|> ObjetOhara
Personnage --|> ObjetOhara
Equipage --|> ObjetOhara
Bateau --|> ObjetOhara
Bestiaire --|> ObjetOhara
# Ohara
Ohara est le nom d'une île dans le manga One Piece, écrit par Eiichiro Oda. Cette île abritait de nombreux archéologues qui cherchaient à déceler les mystères du monde. Nous avons choisi le nom Ohara pour notre projet lié à la SAE 2.01, car notre application représente une véritable encyclopédie rassemblant des informations sur One Piece. Avec des centaines de personnages, des dizaines d'îles et de nombreux arcs d'histoire, il peut être difficile de se souvenir de tous les détails. Notre application a été conçue pour aider les fans à accéder facilement à toutes les informations sur One Piece, en offrant une expérience utilisateur fluide et intuitive.
# Sommaire :
[Diagramme de classe](#classe)
[Diagramme de classe en mettant en avant la partie persistance ](#classePer)
[Diagramme de classe sur nos parties ajoutées](#ajoute)
[Diagramme de paquetage](#paquetage)
[Diagramme de paquetage avec persistance](#paquetagePer)
[Diagramme de séquence : "Serialization"](#serialization)
[Diagramme de séquence : "Mettre un objet en favoris"](#fav)
[Diagramme de séquence : "Créer un objet"](#objet)
[Diagramme d'architecture](#archi)
# Diagramme de classe <a id="classe"></a>
```plantuml
@startuml
hide circle
allowmixing
skinparam classAttributeIconSize 0
skinparam classBackgroundColor #ffffb9
skinparam classBorderColor #800000
skinparam classArrowColor #800000
skinparam classFontColor #black
skinparam classFontName Tahoma
class Bateau {
+ string NomRomanise
+ int PremierChap
+ int PremierEp
+ string Description
+ string Caracteristique
+ Bateau(string nom, string nomRomanise, int premierChap, int premierEp,\n string description, string caracteristique, string image)
+ Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap,\n int premierEp, string description, string caracteristique, string image)
}
class Bestiaire {
+ string Origine
+ string Description
+ string Caracteristique
+ Besiaire(string nom, string origine,string description,\n string caracteristiques)
+ Bestiaire(string nom, string origine, string description,\n string caracteristiques, string image)
}
class Equipage {
+ string NomRomanise
+ string Region
+ int PremierChap
+ int PremierEp
+ bool Statut
+ string Description
+ Equipage(string nom, string nomRomanise, string region, int premierChap,\n int premierEp, bool statut, string description)
+ Equipage(string nom, string nomRomanise, string region, int premierChap,\n int premierEp, bool statut, string description, string image)
}
class FruitDuDemon {
+ string NomRomanise
+ string Type
+ int PremierChap
+ int PremierEp
+ string Description
+ string Forces
+ string Faiblesses
+ FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp,\n string description, string forces, string faiblesses)
+ FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp,\n string description, string forces, string faiblesses, string image)
+ FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description,\n string forces, string faiblesses, string image, List<Personnage> utilisateur)
}
class Ile {
+ string NomRomanise
+ string Region
+ int PremierChap
+ int PremierEp
+ string Description
+ string Geographie
+ Ile(string nom, string nomRomanise, string region, int premierChap, \n int premierEp, string description, string geographie)
+ Ile(string nom, string nomRomanise, string region, int premierChap, \n int premierEp, string description, string geographie, string image)
}
class Personnage {
+ double Prime
+ string Epithete
+ int Age
+ double Taille
+ string Origine
+ string Biographie
+ string Citation
+ Personnage(string nom , double prime, string epithete, int age, dobule taille,\n string origine, string biographie,string citation)
+ Personnage(string nom , double prime, string epithete, int age, dobule taille,\n string origine, string biographie,string citation, string image)
}
class ObjetOhara {
+ string Nom
+ string? Image
+ bool EstFavori
ObjetOhara(string nom, string image)
}
class XML_Serializer {
+ XML_Serializer(string path)
+ void SetPersonnage(List<Personnage> listePerso)
+ void SetFDD(List<FruitDuDemon> listeFDD)
+ void SetBestiaire(List<Bestiaire> listeBest)
+ void SetEquipage(List<Equipage> listeEquip)
+ void SetIle(List<Ile> listIle)
+ void SetBateau(List<Bateau> listeBateau)
+ IEnumerable<Bateau> GetBateaux()
+ IEnumerable<Bestiaire> GetBestiaires()
+ IEnumerable<Equipage> GetEquipages()
+ IEnumerable<FruitDuDemon> GetFruits()
+ IEnumerable<Ile> GetIles()
+ IEnumerable<Personnage> GetPersonnages()
}
interface IDataManager {
IEnumerable<Bateau> GetBateaux()
IEnumerable<Bestiaire> GetBestiaires()
IEnumerable<Equipage> GetEquipages()
IEnumerable<FruitDuDemon> GetFruits()
IEnumerable<Ile> GetIles()
IEnumerable<Personnage> GetPersonnages()
void SetBateau(List<Bateau> listeBateaux);
void SetBestiaire(List<Bestiaire> listeBest);
void SetEquipage(List<Equipage> listeEquip);
void SetFDD(List<FruitDuDemon> listeFDD);
void SetIle(List<Ile> listeIle);
void SetPersonnage(List<Personnage> listePerso);
}
class Manager {
+ IDataManager DataManager
+ ObservableCollection<Bateau> Bateaux
+ ObservableCollection<Personnage> Personnages
+ ObservableCollection<Fruits> Fruits
+ ObservableCollection<Ile> Iles
+ ObservableCollection<Bestiaire> Bestiaire
+ ObservableCollection<Equipage> Equipage
+ ObjetOhara? SelectedItem
+ Manager(IDataManager dataManager)
+ List<Personnage> GetPersonnages()
+ List<FruitDuDemon> GetFruits()
+ List<Equipage> GetEquipages()
+ List<Bateau> GetBateaux()
+ List<Bestiaire> GetBestiaires()
+ List<Ile> GetIles()
+ List<FruitDuDemon> FiltrerFDD(string type)
+ List<ObjetOhara> RecherObjetOhara(string text, List<ObjetOhara> liste)
+ List<ObjetOhara> GetFavoris()
+ void ModifierFavFDD(FruitDuDemon fdd, bool value)
+ void ModifierFavEquip(Equipage equip, bool value)
+ void ModifierFavBest(Bestiaire bestiaire, bool value)
+ void ModifierFavPerso(Personnage perso, bool value)
+ void ModifierFavIle(Ile ile, bool value)
+ void ModifierFavBateau(Bateau bateau, bool value)
+ void AjouterFDD(FruitDuDemon fruit)
+ void AjouterEquip(Equipage equip)
+ void AjouterBest(Bestiaire best)
+ void AjouterPerso(Personnage perso)
+ void AjouterIle(Ile ile)
+ void AjouterBataeu(Bateau bateau)
+ void SuppimerFDD(FruitDuDemon fruit)
+ void SuppimerEquip(Equipage Equipage)
+ void SuppimerBest(Bestiaire best)
+ void SuppimerPerso(Personnage perso)
+ void SuppimerIle(Ile ile)
+ void SuppimerBateau(Bateau bateau)
}
class StubManager {
+ StubPersonnage StubPersonnage
+ StubFruitDuDemon StubFruitDuDemon
+ StubEquipage StubEquipage
+ StubBateau StubBateau
+ StubBestiaire StubBestiaire
+ StubIle StubIle
+ StubManager()
+ IEnumerable<Personnage> GetPersonnages()
+ IEnumerable<FruitDuDemon> GetFruits()
+ IEnumerable<Equipage> GetEquipages()
+ IEnumerable<Bateau> GetBateaux()
+ IEnumerable<Bestiaire> GetBestiaires()
+ IEnumerable<Ile> GetIles()
+ void SetBateau(List<Bateau> listeBateaux)
+ void SetBestiaire(List<Bestiaire> listeBest)
+ void SetEquipage(List<Equipage> listeEquip)
+ void SetFDD(List<FruitDuDemon> listeFDD)
+ void SetILe(List<Ile> listeIle)
+ void SetPersonnage(List<Personnage> listePerso)
}
class StubBateau {
+ IEnumerable<Bateau> RecupererBateau()
}
class StubBestiaire {
+ IEnumerable<Bestiaire> RecupererBestiaire()
}
class StubEquipage {
+ IEnumerable<Equipage> RecupererEquipage()
}
class StubFruitDuDemon {
+ IEnumerable<FruitDuDemon> RecupererFruitDuDemon()
}
class StubIle {
+ IEnumerable<Ile> RecupererIle()
}
class StubPersonnage {
+ IEnumerable<Personnage> RecupererPersonnage()
}
FruitDuDemon --> "+ Utilisateur" Personnage
Personnage --> "+ Equipage" Equipage
Personnage --> "+ Fruit" FruitDuDemon
Bateau --> "+ Affiliation" Equipage
Equipage --> "+ Capitaine" Personnage
Equipage --> "+ Membre" Personnage
Equipage --> "+ Allie" Equipage
Ile --|> ObjetOhara
FruitDuDemon --|> ObjetOhara
Personnage --|> ObjetOhara
Equipage --|> ObjetOhara
Bateau --|> ObjetOhara
Bestiaire --|> ObjetOhara
StubManager --|> IDataManager
XML_Serializer --|> IDataManager
StubManager --> "+ StubIle" StubIle
StubManager --> "+ StubFruitDuDemon" StubFruitDuDemon
StubManager --> "+ StubPersonnage" StubPersonnage
StubManager --> "+ StubEquipage" StubEquipage
StubManager --> "+ StubBateau" StubBateau
StubManager --> "+ StubBestiaire" StubBestiaire
Manager --> "+ DataManager" IDataManager
StubIle *--> "+ ile" Ile
StubFruitDuDemon *--> "+ fdd" FruitDuDemon
StubPersonnage *--> "+ perso" Personnage
StubEquipage *--> "+ Lequipage" Equipage
StubBateau *--> "+ bateau" Bateau
StubBestiaire *--> "+ best" Bestiaire
@enduml
```
# Description du diagramme de classe
Ceci est le diagramme de classe de notre application Ohara se basant sur l'univers de l'oeuvre.
Il possède 7 classes :
-Bateau
-> Classe qui représente les différents bateaux avec leur nom, leur affiliation à un équipage (Implémentation de la classe Equipage), quand on les voit pour la première fois dans le manga et dans l'anime.
-Bestiaire
-> La classe Bestiaire représente toutes les races présents dans l'univers de One Piece avec leur nom, leur origine, une description ainsi que les caractéristiques de la race.
-Equipage
-> La classe Equipage représente les différents équipages de l'univers One Piece, c'est-à-dire les regroupements de pirates (personnages) qui se regroupent pour partir à l'aventure. On retrouve dans cette classe le nom de l'équipage, sa provenance (région), quand on le voit pour la première fois dans le manga et dans l'anime, son statut (est-ce que l'équipage est toujours actif ou non) ,une description de l'équipage ainsi qu'une liste des membres de l'équipage (Implémentation de la classe Personnage) et une liste des alliés de l'équipage (D'autre équipages) .
-Fruit du démon
-> La classe Fruit du démon regroupe tous les fruits présents dans l'oeuvre. Les fruits du démons sont des aliments qui, une fois ingéré par un personnage, confère à son utilisateur des pouvoirs spéciaux. Cependant une fois ingéré l'utilisateur perds sa faculté à nager. On retrouve dans cette classe son nom, le type de fruit (paramecia, logia, zoan), quand on le voit pour la première fois dans le manga et dans l'anime, une description du fruit en question, ses forces et ses faiblesses ainsi que son ou ses utilisateurs (Implémentation de la classe Personnage).
-Ile
-> La classe Ile regroupe toutes les îles de l'oeuvre One Piece. On y retrouve son nom, la région dans laquelle elle se situe, quand on la voit pour la première fois dans le manga et dans l'anime, une description de l'île et une description de la localisation de l'île (qu'est-ce qu'il se trouve à proximité par exemple).
-Personnage
-> La classe Personnage regroupe tous les personnages de l'oeuvre One Piece. On y retrouve le nom du personnage, la prime associé au personnage (chaque pirate ayant une prime pour sa capture car ils sont recherchés par l'Etat pour les différents crimes qu'ils ont pu commettre), l'âge du personnage, sa taille, son origine (région de naissance), une biographie associé au personnage pour pouvoir le présenter, et une citation associé au personnage qui le représente (exemple Luffy : "Le roi des pirates, ce sera moi !") ansi qu'un liste cotenant son ou ses équipages (Implémentation de la classe Equipage) et une liste de son ou ses Fruits du démon (Implémentation de FruitDuDemon).
-ObjetOhara
-> La classe ObjetOhara ne représente rien au sein de l'oeuvre One Piece. Elle sert seulement a regrouper le nom, l'image et l'attribut "EstFavori" dans une classe qui sont des éléments qui reviennent dans chaque classes du model, ce qui permet d'éviter la redondance.
Nous avons regroupé le nom et l'image dans une classe "Objet Ohara" dont toutes les autres classes hérite pour éviter la redondance et donc supprimer un certain nombre de ligne et faciliter la démarche.
Il possède aussi 6 stubs + le stub manager :
-StubBateau
-> Le StubBateau sert à implémenter des objets de la classe Bateau au sein de l'application.
-StubBestiaire
-> Le StubBestiaire sert à implémenter des objets de la classe Bestiaire au sein de l'application.
-StubEquipage
-> Le StubEquipage sert à implémenter des objets de la classe Equipage au sein de l'application.
-StubFruitDuDemon
-> Le StubFruitDuDemon sert à implémenter des objets de la classe FruitDuDemon au sein de l'application.
-StubIle
-> Le StubIle sert à implémenter des objets de la classe Ile au sein de l'application.
-StubPersonnage
-> Le StubPersonnage sert à implémenter des objets de la classe Personnage au sein de l'application.
-StubManager
-> Le StubManager sert à gérer les différents Stubs.
Les Stubs sont reliés à chacunes des classes auxquelles ils correspondent (StubBateau à la classe Bateau, StubPersonnage à la classe Personnage, etc...). Ce sont des compositions car si les classes auxquelles ils sont reliés viennent à se faire détruire alors les stubs ne sont plus rien.
Il regroupe aussi :
- La classe Manager qui permet de faire le pont entre l'application et le model, en effet c'est cette classe qui permet de récupérer les données, de les stocker puis de les modifier si nécéssaire. On instancie cette classe au lancement de l'application, et c'est cette instance qui est utilisé dans le code behind de nos vues pour afficher les données, les modifiers, etc... En réseumé tout passe par le manager.
- L'interface IDataManager qui sert justement d'interface pour la récupération des données, c'est à dire que grace à cette interface, que l'on utilise le XML_Serializer ou le StubManager pour récupérer les données, le code reste le même.
- La classe XML_Serializer qui permet de sauvegarder nos données (Sérialization) sous formes de fichier .xml puis de les récupérer (Désérialization) lorsqu'on redémarre l'application par exemple.
Ce diagramme de classe représente la structure de notre application.
# Diagramme de classe en mettant en avant la partie persistance <a id="classePer"></a>
```plantuml
@startuml
hide circle
allowmixing
skinparam classAttributeIconSize 0
skinparam classBackgroundColor #ffffb9
skinparam classBorderColor #800000
skinparam classArrowColor #800000
skinparam classFontColor #black
skinparam classFontName Tahoma
class XML_Serializer #LimeGreen {
+ XML_Serializer(string path)
+ void SetPersonnage(List<Personnage> listePerso)
+ void SetFDD(List<FruitDuDemon> listeFDD)
+ void SetBestiaire(List<Bestiaire> listeBest)
+ void SetEquipage(List<Equipage> listeEquip)
+ void SetIle(List<Ile> listIle)
+ void SetBateau(List<Bateau> listeBateau)
+ IEnumerable<Bateau> GetBateaux()
+ IEnumerable<Bestiaire> GetBestiaires()
+ IEnumerable<Equipage> GetEquipages()
+ IEnumerable<FruitDuDemon> GetFruits()
+ IEnumerable<Ile> GetIles()
+ IEnumerable<Personnage> GetPersonnages()
}
interface IDataManager #LimeGreen {
IEnumerable<Bateau> GetBateaux()
IEnumerable<Bestiaire> GetBestiaires()
IEnumerable<Equipage> GetEquipages()
IEnumerable<FruitDuDemon> GetFruits()
IEnumerable<Ile> GetIles()
IEnumerable<Personnage> GetPersonnages()
void SetBateau(List<Bateau> listeBateaux);
void SetBestiaire(List<Bestiaire> listeBest);
void SetEquipage(List<Equipage> listeEquip);
void SetFDD(List<FruitDuDemon> listeFDD);
void SetIle(List<Ile> listeIle);
void SetPersonnage(List<Personnage> listePerso);
}
class Manager #LimeGreen {
+ IDataManager DataManager
+ ObservableCollection<Bateau> Bateaux
+ ObservableCollection<Personnage> Personnages
+ ObservableCollection<Fruits> Fruits
+ ObservableCollection<Ile> Iles
+ ObservableCollection<Bestiaire> Bestiaire
+ ObservableCollection<Equipage> Equipage
+ ObjetOhara? SelectedItem
+ Manager(IDataManager dataManager)
+ List<Personnage> GetPersonnages()
+ List<FruitDuDemon> GetFruits()
+ List<Equipage> GetEquipages()
+ List<Bateau> GetBateaux()
+ List<Bestiaire> GetBestiaires()
+ List<Ile> GetIles()
+ List<FruitDuDemon> FiltrerFDD(string type)
+ List<ObjetOhara> RecherObjetOhara(string text, List<ObjetOhara> liste)
+ List<ObjetOhara> GetFavoris()
+ void ModifierFavFDD(FruitDuDemon fdd, bool value)
+ void ModifierFavEquip(Equipage equip, bool value)
+ void ModifierFavBest(Bestiaire bestiaire, bool value)
+ void ModifierFavPerso(Personnage perso, bool value)
+ void ModifierFavIle(Ile ile, bool value)
+ void ModifierFavBateau(Bateau bateau, bool value)
+ void AjouterFDD(FruitDuDemon fruit)
+ void AjouterEquip(Equipage equip)
+ void AjouterBest(Bestiaire best)
+ void AjouterPerso(Personnage perso)
+ void AjouterIle(Ile ile)
+ void AjouterBataeu(Bateau bateau)
+ void SuppimerFDD(FruitDuDemon fruit)
+ void SuppimerEquip(Equipage Equipage)
+ void SuppimerBest(Bestiaire best)
+ void SuppimerPerso(Personnage perso)
+ void SuppimerIle(Ile ile)
+ void SuppimerBateau(Bateau bateau)
}
class StubManager #LimeGreen {
+ StubPersonnage StubPersonnage
+ StubFruitDuDemon StubFruitDuDemon
+ StubEquipage StubEquipage
+ StubBateau StubBateau
+ StubBestiaire StubBestiaire
+ StubIle StubIle
+ StubManager()
+ IEnumerable<Personnage> GetPersonnages()
+ IEnumerable<FruitDuDemon> GetFruits()
+ IEnumerable<Equipage> GetEquipages()
+ IEnumerable<Bateau> GetBateaux()
+ IEnumerable<Bestiaire> GetBestiaires()
+ IEnumerable<Ile> GetIles()
}
StubManager --|> IDataManager
XML_Serializer --|> IDataManager
Manager --> "+ DataManager" IDataManager
@enduml
```
# Description du diagramme de classe en mettant en avant la partie persistance
Concernant la persistance de l'application, elle est gérée par la classe XML_Serializer, cette dernière est instanciée en paramètre du constructeur de Manager au lancement de l'application. Elle comporte deux constructeurs un qui ne prend aucun paramètre sauvegardant les informations dans le dossier courrant de l'application et l'autre prenant en paramètre un chemin permettant de choisir où stocker les informations (Dans le cas de notre application les fichier son stocker dans le 'AppDataDirectory'). Au lancement de l'application le constructeur de la classe XML_Serializer est donc lancé et il va, si un fichiers .xml n'est pas présent ( il y a un fichier .xml par classe sauf la classe ObjetOhara), le créer à l'aide du StubManager et les méthodes SetPersonnage, SetBateau, etc... Sinon il ne fait rien car les fichiers sont déjà tous présent. Le manager va donc pouvoir ensuite utliser les différentes méthodes get du XML_Serializer pour récupérer les objets et les mettres dans ses collections (Fruits,Personnages,...). Enfin concernant la sauvegarde des informations, dès qu'un objet est modifié, créé ou supprimé à l'aide des méthodes du Manager, il va simplement rappeler la méthode Set de l'objet concerné ce qui est assez lourd mais fonctionnel.
# Diagramme de classes sur nos parties ajoutées <a id="ajoute"></a>
```plantuml
@startuml
hide circle
allowmixing
skinparam classAttributeIconSize 0
skinparam classBackgroundColor #ffffb9
skinparam classBorderColor #800000
skinparam classArrowColor #800000
skinparam classFontColor #black
skinparam classFontName Tahoma
class Manager {
+ IDataManager DataManager
+ ObservableCollection<Bateau> Bateaux
+ ObservableCollection<Personnage> Personnages
+ ObservableCollection<Fruits> Fruits
+ ObservableCollection<Ile> Iles
+ ObservableCollection<Bestiaire> Bestiaire
+ ObservableCollection<Equipage> Equipage
+ ObjetOhara? SelectedItem
+ Manager(IDataManager dataManager)
+ List<Personnage> GetPersonnages()
+ List<FruitDuDemon> GetFruits()
+ List<Equipage> GetEquipages()
+ List<Bateau> GetBateaux()
+ List<Bestiaire> GetBestiaires()
+ List<Ile> GetIles()
+ List<FruitDuDemon> FiltrerFDD(string type)
+ List<ObjetOhara> RecherObjetOhara(string text, List<ObjetOhara> liste)
+ List<ObjetOhara> GetFavoris()
+ void ModifierFavFDD(FruitDuDemon fdd, bool value)
+ void ModifierFavEquip(Equipage equip, bool value)
+ void ModifierFavBest(Bestiaire bestiaire, bool value)
+ void ModifierFavPerso(Personnage perso, bool value)
+ void ModifierFavIle(Ile ile, bool value)
+ void ModifierFavBateau(Bateau bateau, bool value)
+ void AjouterFDD(FruitDuDemon fruit)
+ void AjouterEquip(Equipage equip)
+ void AjouterBest(Bestiaire best)
+ void AjouterPerso(Personnage perso)
+ void AjouterIle(Ile ile)
+ void AjouterBataeu(Bateau bateau)
+ void SuppimerFDD(FruitDuDemon fruit)
+ void SuppimerEquip(Equipage Equipage)
+ void SuppimerBest(Bestiaire best)
+ void SuppimerPerso(Personnage perso)
+ void SuppimerIle(Ile ile)
+ void SuppimerBateau(Bateau bateau)
}
class ObjetOhara {
+ string Nom
+ string? Image
+ bool EstFavori
ObjetOhara(string nom, string image)
}
@enduml
```
# Description du diagramme de classes sur nos parties ajoutées
Notre application possède la fonctionnalité d'ajouter un objet à nos favoris, cette fonctionnalité permet à l'utilisateur de retrouver plus facilement des information qui l'interesse grâce à une page de l'application qui affiche directement tout les objets ajoutés en favori. Cette fonctionnalité est gérée par le manager à travers les méthodes: GetFavoris, qui permet de récupérer tout les objets ajoutés en favoris et de les renvoyer sous forme de liste et ModifierFav(Type de l'objet) qui permet d'ajouter ou d'enlever un favoris. Ces méthodes s'appuient sur la propriété EstFavori de type booléen de la classe mère de toute de nos classe ObjetOhara, si cette propriété est égale à true alors l'objet fait partie des favoris.
# Diagramme de paquetage <a id="paquetage"></a>
![logo](img/diagramme_paquetage.png)
# Description du diagramme de paquetage
Le diagramme de paquetage regroupe nos 4 solutions, le Model, le TestProject, le TestUnitaire et Ohara(vue).
A l'intérieur du Model nous avons regroupé tous les fichiers dans différents dossier pour pouvoir améliorer la visibilité de notre projet et pour ne pas se perdre dans les fichiers. On peut retrouver les dossiers suivants :
-Classes : Ici retrouve toutes les classes de notre application,
-Stub : Ici on retrouve tout ce qui est lié au Stub de notre application,
-Managers : Ici on retrouve le IDataManager et le Manager,
-Serializer : Ici on retrouve tout ce qui est lié à la serialization (XML_Serializer).
Pour continuer dans notre vue il y a le dossier Ressources qui regroupe les dossiers Styles et Images.
Dans le dossier Image on retrouve toutes les images concernant l'application (images de personnages, logo, diagramme de paquetage, etc...).
Dans le dossier Styles on retrouve les Styles de notre application.
# Diagramme de paquetage avec persistance <a id="paquetagePer"></a>
![logo](img/diagramme_paquetage_persistance.png)
# Description du diagramme de paquetage avec persistance
Nous avans déjà décrit avec précisions le fonctionnement de la persistance
dans notre application dans la partie "Description du diagramme de classe en mettant en avant la partie persistance". Pour faire le lien avec le diagramme de paquetage, la partie persistance est principalement assurée par le dosser "Serializer" même si le processus implique les dossiers Managers et Stub l'un pour récupérer les données à sauvegarder (Manager) et l'autre pour récupérer les données si les fichiers n'existent pas (Stub).
# Diagramme de séquence
## Serialization <a id="serialization"></a>
```plantuml
@startuml
actor Utilisateur
participant Front
participant Serializer
participant Files
participant Manager
collections Collections
Utilisateur -> Front: Démarrage de l'application
Front --> Manager: Instanciation du Manager
Manager -> Serializer: Instanciation du Serializer
Serializer -> Files: Si les fichiers existent, récupération des données avec les méthodes Get(Type de l'objet) du Serializer
Serializer -> Stub: Si les fichiers n'existent pas, récupération des données avec les méthodes Get(Type de l'objet) du StubManager
Serializer -> Manager: Renvoie des données
Manager -> Collections: Enregistrement des données dans les collections
Manager --> Front: Données utilisables par les vues
Front --> Utilisateur: Affichage des données (Binding)
@enduml
```
## Description du diagramme de séquence de la Serialization
Tout d'abord, l'utilisateur démarre l'application MAUI, ensuite le Front s'occupe d'appeler la fonction de chargement, puis le Serializer récupère les données dans les fichiers et charge les données dans des collections qui sont ensuite utilisables par les vues.
## Mettre un objet en favoris <a id="fav"></a>
```plantuml
@startuml
actor Utilisateur
participant Front
participant Serializer
participant Files
participant Manager
collections Collections
Utilisateur -> Front: Démarrage de l'application
Front --> Utilisateur: Affichage de l'interface
Utilisateur -> Front: Choisi une page avec le menu de navigation
Front --> Utilisateur: Affichage de la page avec les objets correspondant
Utilisateur -> Front: Clique sur un objet
Front --> Utilisateur: Affichage de la page avec les informations de l'objet
Utilisateur -> Front: Clique sur le boutton "ajouter cet objet au favoris"
Front -> Manager: Appel de la méthode ModifierFav pour l'objet
Manager -> Collections: Modification de l'objet dans la collection
Manager --> Serializer: Appel de la méthode Set(Type de l'objet)
Serializer -> Files: Sauvegarde de l'information dans le fichier .xml
@enduml
```
## Description du diagramme de séquence de "Mettre un objet en favoris"
Pour approfondir, ce diagramme de séquence, lorsque un utilisatuer ajoute un objet en favoris, la méthode ModifierFav correspondant à l'objet modifie son attribut EstFavori pour le passer en true, ensuite lorsque un utilisateur souhaite afficher ses favoris, la vue fait un appel à la méthode GetFavoris du Manager qui renvoie une liste contenant tout les objets de chaque collection ayant EstFavori en true.
## Créer un objet <a id="objet"></a>
```plantuml
@startuml
actor Utilisateur
participant Front
participant Serializer
participant Files
participant Manager
collections Collections
Utilisateur -> Front: Démarrage de l'application
Front --> Utilisateur: Affichage de l'interface
Utilisateur -> Front: Choisi une page avec le menu de navigation
Front --> Utilisateur: Affichage de la page avec les objets correspondant
Utilisateur -> Front: Clique le bouton ajouter
Front --> Utilisateur: Affichage du formulaire coresspondant à l'objet
Utilisateur -> Front: Rempli le formulaire et clique sur le boutton confirmer
Front -> Manager: Appel à la méthode Add(Type de l'objet)
Manager -> Collections: Ajout du nouvel objet à la collection correspondante
Manager --> Serializer: Appel de la méthode Set(Type de l'objet)
Serializer -> Files: Sauvegarde du nouvel objet dans le fichier .xml
@enduml
```
## Description du diagramme de séquence de "Créer un objet"
Pour approfondir ce diagrammme, lorsqu'un utilisateur clique sur le bouton pour ajouter un objet, une page modal s'ouvre avec un formulaire permettant de définir les propriétés de l'objet ainsi que un bouton pour annuler et un autre pour confirmer qui fait appel à la méthode Add(Type de l'objet) du manager qui va ajouter l'objet à la collection qui lui correspond et faire un appel à la méthode Set(Type de l'objet) du serializer pour sauvergarder le nouvel objet.
# Diagramme d'architecture <a id="archi"></a>
![logo](img/diagramme_archi.png)
# Description du diagramme d'architecture
Nous avons donc notre application principale Ohara sous la solution ".sln" sous .NET 7 avec MAUI. A cela est relié la documentation réalisée grâce à Doxygen. Nous avons ensuite la serialization faites avec XML_serializer, nos crééons des fichiers ".xml" pour chaque classe de notre application (par exemple personnages.xml). Si jamais ce fichier existe déjà, il est écrasé par la méthode "set". Nous avons ensuite Drone et Sonar qui sont reliés à la CI et la CD de notre application et qui permettent de réaliser correctement la déploiement de notre application de part la détection d'erreurs, de duplication de code, etc...

@ -1,60 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
{
[DataContract(Name = "bateau")]
public class Bateau : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
[DataMember(Name = "affiliation", EmitDefaultValue = false)]
public Equipage? Affiliation { get; set; }
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
[DataMember(Name = "description")]
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 = "baseimage.png") : base(nom,image)
{
NomRomanise = nomRomanise;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
premierChap = 0;
}
else
{
PremierChap = premierChap;
}
Description = description;
Caracteristique = caracteristique;
}
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)
{
Affiliation = affiliation;
}
}
}

@ -1,32 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
{
[DataContract(Name = "bestiaire")]
public class Bestiaire : ObjetOhara
{
[DataMember(Name = "origine")]
public string Origine { get; set; }
[DataMember(Name = "description")]
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)
{
Origine = origine;
Description = description;
Caracteristique = caracteristique;
}
}
}

@ -0,0 +1,159 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "bateau")]
public class Bateau : ObjetOhara
{
[DataMember(Name = "nomromanise")]
private string? nomromanise;
public string? NomRomanise {
get=>nomromanise;
set
{
if(nomromanise == value) return;
nomromanise = value;
OnPropertyChanged();
}
}
[DataMember(Name = "affiliation", EmitDefaultValue = false)]
private Equipage? equipage;
public Equipage? Affiliation {
get=>equipage;
set
{
if(equipage == value) return;
equipage = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierchap")]
private int premierchap;
public int PremierChap
{
get => premierchap;
set
{
if (premierchap == value) return;
premierchap = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierep")]
private int premierep;
public int PremierEp
{
get => premierep;
set
{
if (premierep == value) return;
premierep = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
private string? description;
public string? Description
{
get => description;
set
{
if (description == value) return;
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "caracteristique")]
private string? caracteristique;
public string? Caracteristique {
get=> caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
OnPropertyChanged();
}
}
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string? caracteristique) : base(nom)
{
if (String.IsNullOrEmpty(nomRomanise))
NomRomanise = "";
else
NomRomanise = nomRomanise;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0 )
{
PremierChap = 0;
}
else
{
PremierChap = premierChap;
}
if (String.IsNullOrEmpty(description))
Description = "Description du bateau ...";
else
Description = description;
if (String.IsNullOrEmpty(caracteristique))
Caracteristique = "Caracteristiques du bateau ...";
else
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)
{
if (String.IsNullOrEmpty(image))
image = "baseimage.png";
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Bateau o = (Bateau)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(NomRomanise, Affiliation, PremierChap, PremierEp, Description, Caracteristique);
}
public override string ToString()
{
return "Bateau : " + Nom +" "+EstFavori +" " + NomRomanise + " " + Affiliation + " " + PremierChap + " " + PremierEp + " " + Description + " " + Caracteristique +" "+ Image;
}
}
}

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "bestiaire")]
public class Bestiaire : ObjetOhara
{
[DataMember(Name = "origine")]
private string? origine;
public string? Origine {
get=>origine;
set
{
if (origine == value) return;
origine = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
private string? description;
public string? Description {
get=>description;
set
{
if (description == value) return;
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "caracteristique")]
private string? caracteristique;
public string? Caracteristique {
get=>caracteristique;
set
{
if(caracteristique == value) return;
caracteristique = value;
OnPropertyChanged();
}
}
public Bestiaire(string nom, string origine, string description, string caracteristique) : base(nom)
{
if (String.IsNullOrEmpty(origine))
origine = "Grand Line";
Origine = origine;
if (String.IsNullOrEmpty(description))
description = "Pour décrire ...";
Description = description;
if (String.IsNullOrEmpty(caracteristique))
caracteristique = "Les caracteristiques ...";
Caracteristique = caracteristique;
}
public Bestiaire(string nom, string origine, string description, string caracteristique, string image) : this(nom, origine, description, caracteristique)
{
if (String.IsNullOrWhiteSpace(image))
image = "baseimage.png";
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Bestiaire o = (Bestiaire)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(Origine, Description, Caracteristique);
}
public override string ToString()
{
return "Bestiaire : " + Nom +" "+EstFavori+ " " + Origine + " " + Description + " " + Caracteristique +" " + Image;
}
}
}

@ -0,0 +1,182 @@
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "equipage")]
public class Equipage : ObjetOhara
{
[DataMember(Name = "nomromanise")]
private string? nomromanise;
public string? NomRomanise
{
get => nomromanise;
set
{
nomromanise = value;
OnPropertyChanged();
}
}
[DataMember(Name = "region")]
private string? region;
public string? Region {
get=> region;
set
{
region = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierchap")]
private int premierchap;
public int PremierChap {
get=>premierchap;
set
{
premierchap = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierep")]
private int premierep;
public int PremierEp {
get=>premierep;
set
{
premierep = value;
OnPropertyChanged();
}
}
[DataMember(Name = "statut")]
private bool statut;
public bool Statut {
get=>statut;
set
{
statut = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
private string? description;
public string? Description {
get=>description;
set
{
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "capitaine")]
private Personnage? capitaine;
public Personnage? Capitaine {
get=>capitaine;
set
{
capitaine = value;
OnPropertyChanged();
}
}
[DataMember(Name = "membre")]
private ObservableCollection<Personnage> membre = new ObservableCollection<Personnage>();
public IReadOnlyCollection<Personnage> Membre { get=>membre; }
public void AjouterMembre(Personnage? p)
{
if(p!=null) membre.Add(p);
}
public void RetirerMembre(Personnage? p)
{
if(p!=null) membre.Remove(p);
}
public void ViderMembre() => membre.Clear();
[DataMember(Name = "allie")]
private ObservableCollection<Equipage> allie = new ObservableCollection<Equipage>();
public IReadOnlyCollection<Equipage> Allie { get => allie; }
public void AjouterAllie(Equipage? p)
{
if (p != null) allie.Add(p);
}
public void RetirerAllie(Equipage? p)
{
if (p != null) allie.Remove(p);
}
public void ViderAllie() => allie.Clear();
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description) : base(nom)
{
NomRomanise = nomRomanise;
Region = region;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
premierChap = 0;
}
else
{
PremierChap = premierChap;
}
Statut = statut;
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)
{
if (String.IsNullOrWhiteSpace(image))
{
image = "baseimage.png";
}
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Equipage o = (Equipage)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(NomRomanise, Region, PremierChap, PremierEp, Statut, Description);
}
public override string ToString()
{
return "Equipage : " + Nom +" "+EstFavori+ " " + NomRomanise + " " + Region + " " + PremierChap + " " + PremierEp + " " + Statut + " " + Description + " " + Image;
}
}
}

@ -0,0 +1,147 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "fruitdudemon")]
public class FruitDuDemon : ObjetOhara
{
[DataMember(Name = "nomromanise")]
private string? nomromanise;
public string? NomRomanise {
get=>nomromanise;
set
{
nomromanise = value;
OnPropertyChanged();
}
}
[DataMember(Name = "type")]
private string? type;
public string? Type {
get=>type;
set
{
type = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierchap")]
private int premierchap;
public int PremierChap {
get=>premierchap;
set
{
premierchap = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierep")]
private int premierep;
public int PremierEp {
get=>premierep;
set
{
premierep=value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
private string? description;
public string? Description {
get=>description;
set
{
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "forces")]
private string? forces;
public string? Forces {
get=>forces;
set
{
forces = value;
OnPropertyChanged();
}
}
[DataMember(Name = "faiblesses")]
private string? faiblesses;
public string? Faiblesses {
get=>faiblesses;
set
{
faiblesses = value;
OnPropertyChanged();
}
}
[DataMember(Name = "utilisateur", EmitDefaultValue = false)]
public List<Personnage> Utilisateur { get; set; } = new List<Personnage>();
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses) : base(nom)
{
NomRomanise = nomRomanise;
Type = type;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
PremierChap = 0;
}
else
{
PremierChap = premierChap;
}
Description = description;
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)
{
if (String.IsNullOrWhiteSpace(image))
image = "baseimage.png";
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
FruitDuDemon o = (FruitDuDemon)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(NomRomanise, Type, PremierChap, PremierEp, Description, Forces, Faiblesses);
}
public override string ToString()
{
return "FruitDuDemon : " + Nom +" " +EstFavori+" " + NomRomanise + " " + Type + " " + PremierChap + " " + PremierEp + " " + Description + " " + Forces +" "+Faiblesses+ " " + Image;
}
}
}

@ -0,0 +1,148 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "ile")]
public class Ile : ObjetOhara
{
[DataMember(Name = "nomromanise")]
private string? nomromanise;
public string? NomRomanise
{
get => nomromanise;
set
{
nomromanise = value;
OnPropertyChanged();
}
}
[DataMember(Name = "region")]
private string? region;
public string? Region {
get=>region;
set
{
region = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierchap")]
private int premierchap;
public int PremierChap {
get=>premierchap;
set
{
premierchap = value;
OnPropertyChanged();
}
}
[DataMember(Name = "premierep")]
private int premierep;
public int PremierEp {
get=>premierep;
set
{
premierep = value;
OnPropertyChanged();
}
}
[DataMember(Name = "description")]
private string? description;
public string? Description {
get=>description;
set
{
description = value;
OnPropertyChanged();
}
}
[DataMember(Name = "geographie")]
private string? geographie;
public string? Geographie {
get=>geographie;
set
{
geographie = value;
OnPropertyChanged();
}
}
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie) : base(nom)
{
if (String.IsNullOrWhiteSpace(nomRomanise))
nomRomanise = "Nom romanisé de l'île...";
NomRomanise = nomRomanise;
if (String.IsNullOrWhiteSpace(region))
region = "Grand Line";
Region = region;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
PremierChap = 0;
}
else
{
PremierChap = premierChap;
}
if (String.IsNullOrWhiteSpace(description))
description = "Description de l'île ...";
Description = description;
if (String.IsNullOrWhiteSpace(geographie))
geographie = "Situation géographique de l'ile...";
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)
{
if(String.IsNullOrWhiteSpace(image)) {
image = "baseimage.png";
}
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Ile o = (Ile)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(NomRomanise, Region, PremierChap, PremierEp, Description, Geographie);
}
public override string ToString()
{
return "Ile : "+ Nom +" "+NomRomanise+" "+Region+" "+PremierChap+" "+PremierEp+" "+Description+" "+Geographie+" "+Image;
}
}
}

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model.Classes
{
[DataContract(Name = "objetohara")]
public class ObjetOhara : INotifyPropertyChanged
{
public event PropertyChangedEventHandler? PropertyChanged;
[DataMember(Name = "nom")]
private string? nom;
public string? Nom {
get => nom;
set
{
nom = value;
OnPropertyChanged();
}
}
[DataMember(Name = "image")]
private string? image;
public string? Image {
get => image;
set
{
image = value;
OnPropertyChanged();
}
}
[DataMember(Name = "estfavori")]
private bool estfavori;
public bool EstFavori {
get=>estfavori;
set
{
estfavori = value;
}
}
public ObjetOhara(string nom, string image = "baseimage.png", bool estFavori = false)
{
Nom = nom;
Image = image;
EstFavori = estFavori;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
ObjetOhara o = (ObjetOhara)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(Nom, Image,EstFavori);
}
public override string ToString()
{
return "ObjetOhara : " + Nom + " " +EstFavori+ " " + Image;
}
protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
}

@ -0,0 +1,169 @@
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization;
namespace Model.Classes
{
[DataContract(Name = "personnage")]
public class Personnage : ObjetOhara
{
[DataMember(Name = "prime")]
private double prime;
public double Prime {
get=>prime;
set
{
prime = value;
OnPropertyChanged();
}
}
[DataMember(Name = "epithete")]
private string? epithete;
public string? Epithete {
get=>epithete;
set
{
epithete = value;
}
}
[DataMember(Name = "age")]
private int age;
public int Age {
get=>age;
set
{
age = value;
OnPropertyChanged();
}
}
[DataMember(Name = "taille")]
private double taille;
public double Taille {
get=>taille;
set
{
taille = value;
OnPropertyChanged();
}
}
[DataMember(Name = "origine")]
private string? origine;
public string? Origine {
get=>origine;
set
{
origine = value;
OnPropertyChanged();
}
}
[DataMember(Name = "biographie")]
private string? biographie;
public string? Biographie {
get=>biographie;
set
{
biographie = value;
OnPropertyChanged();
}
}
[DataMember(Name = "citation")]
private string? citation;
public string? Citation {
get=>citation;
set
{
citation = value;
OnPropertyChanged();
}
}
[DataMember(Name = "equipage", EmitDefaultValue = false)]
private Equipage? equipage;
public Equipage? Equipage {
get => equipage;
set
{
equipage = value;
OnPropertyChanged();
}
}
[DataMember(Name = "fruit", EmitDefaultValue = false)]
private ObservableCollection<FruitDuDemon> fruit = new ObservableCollection<FruitDuDemon>();
public IReadOnlyCollection<FruitDuDemon> Fruit {
get=>fruit;
}
public void AjouterFruit(FruitDuDemon? f)
{
if (f == null) return;
fruit.Add(f);
}
public void RetierFruit(FruitDuDemon? f)
{
if (f == null) return;
fruit.Remove(f);
}
public void ViderFruit() => fruit.Clear();
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation) : base(nom)
{
if (prime < 0)
{
Prime = 0;
}
else
{
Prime = prime;
}
Epithete = epithete;
Age = age;
if (taille < 0)
{
Taille = 0;
}
else
{
Taille = taille;
}
Origine = origine;
Biographie = biographie;
Citation = citation;
}
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)
{
if (String.IsNullOrWhiteSpace(image))
image = "baseimage.png";
Image = image;
}
public override bool Equals(object? obj)
{
if (obj == null) return false;
if (this.GetType() != obj.GetType())
{
return false;
}
else
{
Personnage o = (Personnage)obj;
return o.Nom == Nom;
}
}
public override int GetHashCode()
{
return HashCode.Combine(Prime, Epithete, Age, Origine,Biographie, Citation,Equipage,Fruit);
}
public override string ToString()
{
return "Personnage : " + Nom + " " + EstFavori + " " + Prime + " " + Epithete + " " + Age + " " + Origine + " " + Biographie + " "+ Citation+" " +Equipage+" " + Fruit+" "+ Image;
}
}
}

@ -1,60 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
{
[DataContract(Name = "equipage")]
public class Equipage : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
[DataMember(Name = "region")]
public string Region { get; set; }
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
[DataMember(Name = "statut")]
public bool Statut { get; set; }
[DataMember(Name = "description")]
public string Description { get; set; }
[DataMember(Name = "capitaine")]
public Personnage? Capitaine { get; set; }
[DataMember(Name = "membre")]
public List<Personnage> Membre { get; set; } = new List<Personnage>();
[DataMember(Name = "allie")]
public List<Equipage> Allie { get; set; } = new List<Equipage>();
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description,string image = "baseimage.png") : base(nom,image)
{
NomRomanise = nomRomanise;
Region = region;
if(premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if(premierChap < 0)
{
premierChap = 0;
}
else
{
PremierChap = premierChap;
}
Statut = statut;
Description = description;
}
}
}

@ -1,64 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
{
[DataContract(Name = "fruitdudemon")]
public class FruitDuDemon : ObjetOhara
{
[DataMember (Name = "nomromanise")]
public string NomRomanise { get; set; }
[DataMember(Name = "type")]
public string Type { get; set; }
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
[DataMember(Name = "description")]
public string Description { get; set; }
[DataMember(Name = "forces")]
public string Forces { get; set; }
[DataMember(Name = "faiblesses")]
public string Faiblesses { get; set; }
[DataMember(Name = "utilisateur",EmitDefaultValue = false)]
public List<Personnage> Utilisateur { get; set; }= new List<Personnage>();
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)
{
NomRomanise = nomRomanise;
Type = type;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
premierChap = 0;
}
else
{
PremierChap = premierChap;
}
Description = description;
Forces = forces;
Faiblesses = faiblesses;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses, image)
{
Utilisateur = utilisateur;
}
}
}

@ -1,55 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace Model
{
[DataContract(Name = "ile")]
public class Ile : ObjetOhara
{
[DataMember(Name = "nomromanise")]
public string NomRomanise { get; set; }
[DataMember(Name = "region")]
public string Region { get; set; }
[DataMember(Name = "premierchap")]
public int PremierChap { get; set; }
[DataMember(Name = "premierep")]
public int PremierEp { get; set; }
[DataMember(Name = "description")]
public string Description { get; set; }
[DataMember(Name = "geographie")]
public string Geographie { get; set; }
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image = "baseimage.png") : base(nom,image)
{
NomRomanise = nomRomanise;
Region = region;
if (premierEp < 0)
{
PremierEp = 0;
}
else
{
PremierEp = premierEp;
}
if (premierChap < 0)
{
premierChap = 0;
}
else
{
PremierChap = premierChap;
}
Description = description;
Geographie = geographie;
}
}
}

@ -1,88 +0,0 @@
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class Manager
{
public IDataManager DataManager { get; set; }
public Manager() {
DataManager = new StubManager();
}
public List<Personnage> GetPersonnages()
{
return DataManager.GetPersonnages().ToList();
}
public List<FruitDuDemon> GetFruits()
{
return DataManager.GetFruits().ToList();
}
public List<Equipage> GetEquipages()
{
return DataManager.GetEquipages().ToList();
}
public List<Bateau> GetBateaux()
{
return DataManager.GetBateaux().ToList();
}
public List<Bestiaire> GetBestiaires()
{
return DataManager.GetBestiaires().ToList();
}
public List<Ile> GetIles()
{
return DataManager.GetIles().ToList();
}
public List<FruitDuDemon> FiltrerFDD(string type)
{
List<FruitDuDemon> fdd = GetFruits();
foreach(FruitDuDemon f in fdd.ToList())
{
if(f.Type != type)
{
fdd.Remove(f);
}
}
return fdd;
}
public List<FruitDuDemon> RechercheFDD(string text,List<FruitDuDemon> listeFDD)
{
if (text == "") {
return listeFDD;
}
foreach(FruitDuDemon f in listeFDD.ToList())
{
bool correspondance = false;
int textPos = 0;
for (int i = 0; i < (f.Nom.Length); i++) {
if (string.Equals(text[textPos].ToString(), f.Nom[i].ToString(), StringComparison.OrdinalIgnoreCase))
{
textPos++;
}
if(textPos == text.Length)
{
correspondance = true;
break;
}
}
if (!correspondance)
{
listeFDD.Remove(f);
}
}
return listeFDD;
}
}
}

@ -3,8 +3,9 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model
namespace Model.Managers
{
public interface IDataManager
{
@ -14,5 +15,11 @@ namespace Model
IEnumerable<FruitDuDemon> GetFruits();
IEnumerable<Ile> GetIles();
IEnumerable<Personnage> GetPersonnages();
void SetBateau(List<Bateau> listeBateaux);
void SetBestiaire(List<Bestiaire> listeBest);
void SetEquipage(List<Equipage> listeEquip);
void SetFDD(List<FruitDuDemon> listeFDD);
void SetIle(List<Ile> listeIle);
void SetPersonnage(List<Personnage> listePerso);
}
}

@ -0,0 +1,306 @@
using Model.Classes;
using Microsoft.VisualBasic;
using Model.Serializer;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.IO;
using System.Linq;
using System.Resources;
using System.Text;
using System.Threading.Tasks;
namespace Model.Managers
{
public class Manager
{
public IDataManager DataManager { get; set; }
public ObservableCollection<Bateau> Bateaux { get; set; }
public ObservableCollection<Personnage> Personnages { get; set; }
public ObservableCollection<FruitDuDemon> Fruits { get; set; }
public ObservableCollection<Ile> Iles { get; set; }
public ObservableCollection<Bestiaire> Bestiaire { get; set; }
public ObservableCollection<Equipage> Equipages { get; set; }
public ObjetOhara? SelectedItem { get; set; } = null;
public Manager(IDataManager dataManager) {
DataManager = dataManager;
Bateaux = new ObservableCollection<Bateau>(DataManager.GetBateaux());
Personnages = new ObservableCollection<Personnage>(DataManager.GetPersonnages());
Fruits = new ObservableCollection<FruitDuDemon>(DataManager.GetFruits());
Iles = new ObservableCollection<Ile>(DataManager.GetIles());
Bestiaire = new ObservableCollection<Bestiaire>(DataManager.GetBestiaires());
Equipages = new ObservableCollection<Equipage>(DataManager.GetEquipages());
}
public List<Personnage> GetPersonnages()
{
return DataManager.GetPersonnages().ToList();
}
public List<FruitDuDemon> GetFruits()
{
return DataManager.GetFruits().ToList();
}
public List<Equipage> GetEquipages()
{
return DataManager.GetEquipages().ToList();
}
public List<Bateau> GetBateaux()
{
return DataManager.GetBateaux().ToList();
}
public List<Bestiaire> GetBestiaires()
{
return DataManager.GetBestiaires().ToList();
}
public List<Ile> GetIles()
{
return DataManager.GetIles().ToList();
}
public List<FruitDuDemon> FiltrerFDD(string type)
{
List<FruitDuDemon> fdd = new List<FruitDuDemon>();
fdd=Fruits.Where(p=>p.Type==type).ToList();
return fdd;
}
public List<Bateau> FiltrerBateau(string nom)
{
List<Bateau> bateau = new List<Bateau>();
bateau = Bateaux.Where(p => p.Affiliation?.Nom == nom).ToList();
return bateau;
}
public List<Ile> FiltrerIle(string region)
{
List<Ile> ile = new List<Ile>();
ile = Iles.Where(p => p.Region == region).ToList();
return ile;
}
public List<ObjetOhara> RechercheObjetOhara(string text, List<ObjetOhara> liste)
{
if (text == "")
{
return liste;
}
foreach (ObjetOhara f in liste.ToList())
{
bool correspondance = false;
int textPos = 0;
for (int i = 0; i < (f.Nom?.Length); i++)
{
if (string.Equals(text[textPos].ToString(), f.Nom[i].ToString(), StringComparison.OrdinalIgnoreCase))
{
textPos++;
}
if (textPos == text.Length)
{
correspondance = true;
break;
}
}
if (!correspondance)
{
liste.Remove(f);
}
}
return liste;
}
public List<ObjetOhara> GetFavoris()
{
List<ObjetOhara> listeFavoris = new List<ObjetOhara>();
listeFavoris.AddRange(Bateaux);
listeFavoris.AddRange(Equipages);
listeFavoris.AddRange(Bestiaire);
listeFavoris.AddRange(Fruits);
listeFavoris.AddRange(Iles);
listeFavoris.AddRange(Personnages);
foreach(ObjetOhara obj in listeFavoris.ToList())
{
if (obj.EstFavori == false)
{
listeFavoris.Remove(obj);
}
}
return listeFavoris;
}
public void ModifierFavFDD(FruitDuDemon fruit, bool value)
{
FruitDuDemon? fruitToUpdate = Fruits.FirstOrDefault(b => b.Equals(fruit));
if (fruitToUpdate != null)
{
fruitToUpdate.EstFavori = value;
DataManager.SetFDD(Fruits.ToList());
}
}
public void ModifierFavEquip(Equipage equip, bool value)
{
Equipage? equipToUpdate = Equipages.FirstOrDefault(e => e.Equals(equip));
if (equipToUpdate != null)
{
equipToUpdate.EstFavori = value;
DataManager.SetEquipage(Equipages.ToList());
}
}
public void ModifierFavBest(Bestiaire best, bool value)
{
Bestiaire? bestToUpdate = Bestiaire.FirstOrDefault(b => b.Equals(best));
if (bestToUpdate != null)
{
bestToUpdate.EstFavori = value;
DataManager.SetBestiaire(Bestiaire.ToList());
}
}
public void ModifierFavPerso(Personnage perso, bool value)
{
Personnage? persoToUpdate = Personnages.FirstOrDefault(p => p.Equals(perso));
if (persoToUpdate != null)
{
persoToUpdate.EstFavori = value;
DataManager.SetPersonnage(Personnages.ToList());
}
}
public void ModifierFavIle(Ile ile, bool value)
{
Ile? ileToUpdate = Iles.FirstOrDefault(i => i.Equals(ile));
if (ileToUpdate != null)
{
ileToUpdate.EstFavori = value;
DataManager.SetIle(Iles.ToList());
}
}
public void ModifierFavBateau(Bateau bateau, bool value)
{
Bateau? bateauToUpdate = Bateaux.FirstOrDefault(b => b.Equals(bateau));
if (bateauToUpdate != null)
{
bateauToUpdate.EstFavori = value;
DataManager.SetBateau(Bateaux.ToList());
}
}
public void AjouterFDD(FruitDuDemon fruit)
{
Fruits.Add(fruit);
DataManager.SetFDD(Fruits.ToList());
}
public void AjouterEquip(Equipage equip)
{
Equipages.Add(equip);
DataManager.SetEquipage(Equipages.ToList());
}
public void AjouterBest(Bestiaire best)
{
Bestiaire.Add(best);
DataManager.SetBestiaire(Bestiaire.ToList());
}
public void AjouterPerso(Personnage perso)
{
Personnages.Add(perso);
DataManager.SetPersonnage(Personnages.ToList());
}
public void AjouterIle(Ile ile)
{
Iles.Add(ile);
DataManager.SetIle(Iles.ToList());
}
public void AjouterBateau(Bateau bateau)
{
Bateaux.Add(bateau);
DataManager.SetBateau(Bateaux.ToList());
}
public void SupprimerFDD(FruitDuDemon fruit)
{
Fruits.Remove(fruit);
DataManager.SetFDD(Fruits.ToList());
}
public void SupprimerEquip(Equipage equip)
{
Equipages.Remove(equip);
DataManager.SetEquipage(Equipages.ToList());
}
public void SupprimerBest(Bestiaire best)
{
Bestiaire.Remove(best);
DataManager.SetBestiaire(Bestiaire.ToList());
}
public void SupprimerPerso(Personnage perso)
{
Personnages.Remove(perso);
DataManager.SetPersonnage(Personnages.ToList());
}
public void SupprimerIle(Ile ile)
{
Iles.Remove(ile);
DataManager.SetIle(Iles.ToList());
}
public void SupprimerBateau(Bateau bateau)
{
Bateaux.Remove(bateau);
DataManager.SetBateau(Bateaux.ToList());
}
public void ModifierIle(Ile ile, string ancienNom)
{
Ile? ancienneIle = Iles.FirstOrDefault(p => p.Nom == ancienNom);
if(ancienneIle !=null) {
Iles.Remove(ancienneIle);
Iles.Add(ile);
DataManager.SetIle(Iles.ToList());
}
}
public void ModifierBest(Bestiaire best, string ancienNom)
{
Bestiaire? ancienBest = Bestiaire.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienBest == null) return;
Bestiaire.Remove(ancienBest);
Bestiaire.Add(best);
DataManager.SetBestiaire(Bestiaire.ToList());
}
public void ModifierEquipage(Equipage equip, string ancienNom)
{
Equipage? ancienEquip = Equipages.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienEquip == null) return;
Equipages.Remove(ancienEquip);
Equipages.Add(equip);
DataManager.SetEquipage(Equipages.ToList());
}
public void ModifierBateau(Bateau bateau, string ancienNom)
{
Bateau? ancienBateau = Bateaux.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienBateau == null) return;
Bateaux.Remove(ancienBateau);
Bateaux.Add(bateau);
DataManager.SetBateau(Bateaux.ToList());
}
public void ModifierFDD(FruitDuDemon fruit, string ancienNom)
{
FruitDuDemon? ancienFDD = Fruits.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienFDD == null) return;
Fruits.Remove(ancienFDD);
Fruits.Add(fruit);
DataManager.SetFDD(Fruits.ToList());
}
public void ModifierPerso(Personnage perso, string ancienNom)
{
Personnage? ancienPerso = Personnages.FirstOrDefault(p => p.Nom == ancienNom);
if (ancienPerso == null) return;
Personnages.Remove(ancienPerso);
Personnages.Add(perso);
DataManager.SetPersonnage(Personnages.ToList());
}
}
}

@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>

@ -1,23 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
[DataContract(Name = "objetohara")]
public class ObjetOhara
{
[DataMember (Name = "nom")]
public string Nom { get; set; }
[DataMember (Name ="image")]
public string? Image { get; set;}
public ObjetOhara(string nom,string image) {
Nom = nom;
Image = image;
}
}
}

@ -1,64 +0,0 @@
using System.Runtime.Serialization;
namespace Model
{
[DataContract(Name = "personnage")]
public class Personnage : ObjetOhara
{
[DataMember(Name = "prime")]
public double Prime { get; set; }
[DataMember(Name = "epithete")]
public string Epithete { get; set; }
[DataMember(Name = "age")]
public int Age { get; set; }
[DataMember(Name = "taille")]
public double Taille { get; set; }
[DataMember(Name = "origine")]
public string Origine { get; set; }
[DataMember(Name = "biographie")]
public string Biographie { get; set; }
[DataMember(Name = "citation")]
public string Citation { get; set; }
[DataMember(Name="equipage",EmitDefaultValue = false)]
public Equipage? Equipage { get; set; }
[DataMember(Name="fruit",EmitDefaultValue = false)]
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();
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)
{
if(prime < 0)
{
Prime = 0;
}
else
{
Prime = prime;
}
Epithete = epithete;
Age = age;
if(taille < 0)
{
Taille = 0;
}
else
{
Taille= taille;
}
Origine = origine;
Biographie = biographie;
Citation = citation;
}
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image)
{
Equipage = equipage;
Fruit = fruit;
}
}
}

@ -1,25 +1,64 @@
using System;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
using Model.Classes;
using Model.Managers;
namespace Model.Serializer
{
public class XML_Serializer : IDataManager
{
public string Chemin { get; set; }
public XML_Serializer()
{
StubManager stubManager = new StubManager();
Chemin = Directory.GetCurrentDirectory();
InitialiserFichiers(stubManager);
}
public XML_Serializer(string path)
{
Chemin= path;
StubManager stubManager = new StubManager();
InitialiserFichiers(stubManager);
}
public void InitialiserFichiers(StubManager stubManager)
{
if (!File.Exists(Path.Combine(Chemin, "./personnage.xml")))
{
SetPersonnage(stubManager.GetPersonnages().ToList());
}
if (!File.Exists(Path.Combine(Chemin, "./bateau.xml")))
{
SetBateau(stubManager.GetBateaux().ToList());
}
if (!File.Exists(Path.Combine(Chemin, "./fruitdudemon.xml")))
{
SetFDD(stubManager.GetFruits().ToList());
}
if (!File.Exists(Path.Combine(Chemin, "./bestiaire.xml")))
{
SetBestiaire(stubManager.GetBestiaires().ToList());
}
if (!File.Exists(Path.Combine(Chemin, "./equipage.xml")))
{
SetEquipage(stubManager.GetEquipages().ToList());
}
if (!File.Exists(Path.Combine(Chemin, "./ile.xml")))
{
SetIle(stubManager.GetIles().ToList());
}
}
public void SetPersonnage(List<Personnage> listePerso)
{
var serializer = new DataContractSerializer(typeof(List<Personnage>));
string xmlFile = "personnage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -36,7 +75,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
string xmlFile = "fruitdudemon.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -54,7 +93,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Bestiaire>));
string xmlFile = "bestiaire.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -72,7 +111,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Equipage>));
string xmlFile = "equipage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -90,7 +129,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Ile>));
string xmlFile = "ile.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -108,7 +147,7 @@ namespace Model.Serializer
{
var serializer = new DataContractSerializer(typeof(List<Bateau>));
string xmlFile = "bateau.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
XmlWriterSettings settings = new XmlWriterSettings() { Indent = true };
using (TextWriter tw = File.CreateText(xmlFile))
{
@ -124,24 +163,26 @@ namespace Model.Serializer
public IEnumerable<Bateau> GetBateaux()
{
List<Bateau> listeBateau = new List<Bateau>();
List<Bateau>? listeBateau = new List<Bateau>();
var serializer = new DataContractSerializer(typeof(List<Bateau>));
string xmlFile = "bateau.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
listeBateau = serializer.ReadObject(s) as List<Bateau>;
}
return listeBateau;
}
public IEnumerable<Bestiaire> GetBestiaires()
{
List<Bestiaire> listeBest = new List<Bestiaire>();
List<Bestiaire>? listeBest = new List<Bestiaire>();
var serializer = new DataContractSerializer(typeof(List<Bestiaire>));
string xmlFile = "bestiaire.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -151,10 +192,10 @@ namespace Model.Serializer
}
public IEnumerable<Equipage> GetEquipages()
{
List<Equipage> listeEquip = new List<Equipage>();
List<Equipage>? listeEquip = new List<Equipage>();
var serializer = new DataContractSerializer(typeof(List<Equipage>));
string xmlFile = "equipage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -164,10 +205,10 @@ namespace Model.Serializer
}
public IEnumerable<FruitDuDemon> GetFruits()
{
List<FruitDuDemon> listeFDD = new List<FruitDuDemon>();
List<FruitDuDemon>? listeFDD = new List<FruitDuDemon>();
var serializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
string xmlFile = "fruitdudemon.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -177,10 +218,10 @@ namespace Model.Serializer
}
public IEnumerable<Ile> GetIles()
{
List<Ile> listeIle = new List<Ile>();
List<Ile>? listeIle = new List<Ile>();
var serializer = new DataContractSerializer(typeof(List<Ile>));
string xmlFile = "ile.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{
@ -190,10 +231,10 @@ namespace Model.Serializer
}
public IEnumerable<Personnage> GetPersonnages()
{
List<Personnage> listePerso = new List<Personnage>();
List<Personnage>? listePerso = new List<Personnage>();
var serializer = new DataContractSerializer(typeof(List<Personnage>));
string xmlFile = "personnage.xml";
Directory.SetCurrentDirectory(Path.Combine(Directory.GetCurrentDirectory(), "./"));
Directory.SetCurrentDirectory(Path.Combine(Chemin, "./"));
using (Stream s = File.OpenRead(xmlFile))
{

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using static System.Net.Mime.MediaTypeNames;
namespace Model.Stub
@ -11,11 +12,21 @@ namespace Model.Stub
{
public IEnumerable<Bateau> RecupererBateau()
{
Bateau sunny = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", "sunny.png");
Bateau merry =new Bateau("Vogue Merry", "Goingu Merri-go", 41, 17, "Le Vogue Merry est...", "Ce bateau a pour particularités ...", "vogue_merry.png");
Bateau moby = new Bateau("Moby Dick", "Mobi Dikku-go", 234, 151, "Le Moby Dick est...", "Ce bateau a pour particularités ...", "moby_dick.png");
StubEquipage stubEquipage = new StubEquipage();
StubPersonnage stubPersonnage = new StubPersonnage();
stubEquipage.ChargerEquipage(stubPersonnage.RecupererPersonnage().ToList());
List<Equipage> equipages = stubEquipage.RecupererEquipage().ToList();
sunny.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage au chapeau de paille");
merry.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage au chapeau de paille");
moby.Affiliation = equipages.FirstOrDefault(p => p.Nom == "Équipage de Barbe Blanche");
List<Bateau> bateau = new List<Bateau>()
{
new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", "sunny.png"),
new Bateau("Vogue Merry", "Goingu Merri-go", 41, 17, "Le Vogue Merry est...", "Ce bateau a pour particularités ...", "vogue_merry.png"),
new Bateau("Moby Dick", "Mobi Dikku-go", 234, 151, "Le Moby Dick est...", "Ce bateau a pour particularités ...", "moby_dick.png"),
sunny,
merry,
moby,
};
return bateau;
}

@ -1,25 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Stub
{
public class StubBestiaire
{
public IEnumerable<Bestiaire> RecupererBestiaire()
{
List<Bestiaire> best = new List<Bestiaire>()
{
new Bestiaire("Humains", "??", "Les humains sont ...","Ils possèdent les caractéristiques suivantes ...","humain.png"),
new Bestiaire("Géants", "Elbaf", "Les géants sont ...","Ils possèdent les caractéristiques suivantes ...","geant.png"),
new Bestiaire("Hommes poissons", "Îles des hommes poissons", "Les hommes poissons sont ...","Ils possèdent les caractéristiques suivantes ...","hpoisson.png"),
new Bestiaire("Lunariens", "Redline", "Les lunariens sont ...","Ils possèdent les caractéristiques suivantes ...","lunarien.png"),
new Bestiaire("Minks", "Zo", "Les minks sont ...","Ils possèdent les caractéristiques suivantes ...","minks.png"),
};
return best;
}
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubBestiaire
{
public IEnumerable<Bestiaire> RecupererBestiaire()
{
List<Bestiaire> best = new List<Bestiaire>()
{
new Bestiaire("Humains", "??", "Les humains sont ...","Ils possèdent les caractéristiques suivantes ...","humain.png"),
new Bestiaire("Géants", "Elbaf", "Les géants sont ...","Ils possèdent les caractéristiques suivantes ...","geant.png"),
new Bestiaire("Hommes poissons", "Îles des hommes poissons", "Les hommes poissons sont ...","Ils possèdent les caractéristiques suivantes ...","hpoisson.png"),
new Bestiaire("Lunariens", "Redline", "Les lunariens sont ...","Ils possèdent les caractéristiques suivantes ...","lunarien.png"),
new Bestiaire("Minks", "Zo", "Les minks sont ...","Ils possèdent les caractéristiques suivantes ...","minks.png"),
};
return best;
}
}
}

@ -1,34 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model.Stub
{
public class StubEquipage
{
public IEnumerable<Equipage> RecupererEquipage()
{
List<Equipage> Lequipage = new List<Equipage>()
{
new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...","mugiwara.jpg"),
new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...","roux.png"),
new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...","clown.png"),
new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...","blanche.jpg"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...","noire.png"),
};
return Lequipage;
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubEquipage
{
public List<Equipage>? Equipages { get; set; }
public void ChargerEquipage(List<Personnage> persos)
{
var paille = new Equipage("Équipage au chapeau de paille", "Mugiwara No Ichimi", "East Blue", 1, 1, true, "L'équipage du Chapeau de Paille ...", "mugiwara.jpg");
var roux = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", 1, 4, true, "L'équipage du Roux ...", "roux.png");
var clown = new Equipage("Équipage du Clown", "Bagï Kalzokudan", "East Blue", 8, 4, true, "L'équipage du Clown ...", "clown.png");
var blanche = new Equipage("Équipage de Barbe Blanche", "Shirohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Blanche ...", "blanche.jpg");
var noire = new Equipage("Équipage de Barbe Noire", "Kurohige Kaizokudan", "East Blue", 234, 151, true, "L'équipage de Barbe Noire ...", "noire.png");
paille.AjouterAllie(clown);
paille = RemplirEquipage(paille, persos, new List<string> { "Luffy" });
Equipages = new List<Equipage>()
{
paille,
roux,
clown,
blanche,
};
}
public IEnumerable<Equipage> RecupererEquipage()
{
return Equipages;
}
public Equipage RemplirEquipage(Equipage equipage,List<Personnage> persos,List<string> noms)
{
var persos2 = persos.Where(p => noms.Contains(p.Nom));
foreach (Personnage p in persos2)
equipage.AjouterMembre(p);
return equipage;
}
}
}

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using static System.Net.Mime.MediaTypeNames;
namespace Model.Stub
@ -14,8 +15,8 @@ namespace Model.Stub
List<Ile> ile = new List<Ile>()
{
new Ile("Dawn", "Don-to", "East Blue", 1, 4, "L'île de Dawn est ...", "Cette île est situé dans la mer d'East Blue près de ...", "dawn.png"),
new Ile("Water Seven", "Mizu no Miyako Wōtā Sebun", "Première partie de Grand Line", 323, 229, "Water Seven est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "water_seven.png"),
new Ile("Alabsta", "Arabasuta-Ōkoku'", "Première partie de Grand Line", 113, 78, "L'île d'Alabsta est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "alabasta.png"),
new Ile("Water Seven", "Mizu no Miyako Wōtā Sebun", "Grand Line", 323, 229, "Water Seven est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "water_seven.png"),
new Ile("Alabsta", "Arabasuta-Ōkoku'", "Grand Line", 113, 78, "L'île d'Alabsta est ...", "Cette île est situé dans la première partie de Grand Line près de ...", "alabasta.png"),
};
return ile;
}

@ -1,14 +1,17 @@
using System;
using Model.Serializer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
using Model.Managers;
namespace Model.Stub
{
public class StubManager : IDataManager
{
public StubPersonnage StubPersonnage { get; set; }
public StubFruitDuDemon StubFruitDuDemon { get; set; }
public StubEquipage StubEquipage { get; set; }
@ -28,7 +31,8 @@ namespace Model.Stub
public IEnumerable<Personnage> GetPersonnages()
{
{
return StubPersonnage.RecupererPersonnage();
}
@ -38,6 +42,7 @@ namespace Model.Stub
}
public IEnumerable<Equipage> GetEquipages()
{
StubEquipage.ChargerEquipage(StubPersonnage.RecupererPersonnage().ToList());
return StubEquipage.RecupererEquipage();
}
public IEnumerable<Bateau> GetBateaux()
@ -52,5 +57,35 @@ namespace Model.Stub
{
return StubIle.RecupererIle();
}
public void SetBateau(List<Bateau> listeBateaux)
{
return;
}
public void SetBestiaire(List<Bestiaire> listeBest)
{
return;
}
public void SetEquipage(List<Equipage> listeEquip)
{
return;
}
public void SetFDD(List<FruitDuDemon> listeFDD)
{
return;
}
public void SetIle(List<Ile> listeIle)
{
return;
}
public void SetPersonnage(List<Personnage> listePerso)
{
return;
}
}
}

@ -4,21 +4,65 @@ using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Model.Classes;
namespace Model.Stub
{
public class StubPersonnage
{
public IEnumerable<Personnage> RecupererPersonnage()
{
List<Personnage> perso = new List<Personnage>()
var luffy = new Personnage("Luffy", 3000000000, "Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy (モンキー・D・ルフィ, Monkī Dī Rufi) est un pirate et le principal protagoniste du manga et anime One Piece. Luffy est le fils du chef de l'Armée Révolutionnaire, Monkey D. Dragon, le petit-fils du célèbre héros de la Marine, Monkey D. Garp, le fils adoptif d'une bandit des montagnes, Curly Dadan ainsi que le frère adoptif du défunt Portgas D. Ace et de Sabo.\n\nSon rêve le plus cher est de devenir le Seigneur des Pirates en trouvant le trésor légendaire One Piece, caché quelque part dans le monde par Gol D. Roger. Selon lui, ce rêve se concrétisera, en devenant la personne la plus libre qui soit. Il a mangé par erreur un Fruit du Démon, le Gomu Gomu no Mi, qui lui permet d'être un homme-élastique, que l'Équipage du Roux avait pris à un convoi du Gouvernement Mondial.\n\n En tant que fondateur et Capitaine de l'Équipage du Chapeau de Paille, il est le premier membre à en faire partie. C'est également le fondateur involontaire de la Grande Flotte du Chapeau de Paille, même s'il refuse cependant d'en être le Capitaine, ne désirant pas priver les autres de leur liberté. ", "\"Le Roi des Pirates, ce sera moi !\"", "luffy.png");
var nami = new Personnage("Nami", 366000000, "Le Chatte Voleuse", 20, 1.70, "East Blue", "Nami, alias La Chatte Voleuse (泥棒猫, Dorobō Neko), est la navigatrice de L'Équipage du Chapeau de Paille. Elle est la deuxième personne à se joindre à l'équipage après Zoro. Elle a brièvement trahi l'Équipage du Chapeau de Paille pendant l'Arc Baratie et les rejoignit officiellement à la fin de l'Arc d'Arlong après que son passé et ses intentions furent révélés. Son rêve est de dessiner une carte complète du monde. Sa prime actuelle s'élève à 366 000 000 berry.", "\"Je n'aime que deux choses, l'argent et les mandarines !!\"", "nami.png");
var usopp = new Personnage("Usopp", 500000000, "Dieu Usopp", 19, 1.76, "East Blue", "Usopp (ウソップ, Usoppu), également nommé Pipo dans les anciennes éditions de Glénat du manga, est un membre de L'Équipage du Chapeau de Paille, il occupe le poste de Tireur d'Élite. Il est originaire du Village de Sirop. Bien que n'étant pas Charpentier Naval, il s'occupait également de réparer le Vogue Merry (dont il colmatait les trous avec les moyens du bord). Il est ensuite remplacé par Franky, lorsque ce dernier et le Thousand Sunny rejoignirent l'équipage, pour ce qui est de l'entretien du navire.\n\nLorsquil était au Village de Sirop, il était le Capitaine de l'Équipage du Capitaine Usopp et était connu par les membres de son équipage comme le Capitaine Usopp (船長ウソップ, Kyaputen Usoppu). Il a d'ailleurs gardé ce pseudonyme qui fait partie de ses répliques cultes. Il a dissous l'équipage lorsqu'il est parti en mer et qu'il a rejoint l'Équipage du Chapeau de Paille. Il est le fils de Yasopp, membre de l'Équipage du Roux.\n\nSon rêve est de devenir un valeureux guerrier des mers, et de suivre les traces de son père, et il estime qu'il pourra mourir tranquille lorsqu'il l'aura réalisé. Il pourra alors se dire : \"C'est moi Usopp !! Le preux guerrier des mers!!\".\n\nAlors que sa prime initiale était seulement de 30 000 000 berrys (sous le pseudonyme de Sogeking (そげキング, Sogekingu)) avant l'ellipse, celle-ci a drastiquement augmenté, allant jusqu'à 200 000 000 de berry(sous le pseudonyme de God Usopp (神ウソップ, Goddo Usoppu)) suite aux événements de l'Arc Dressrosa, puis 500.000.000 de berry après les événements de l'Arc Pays des Wa. ", "\"Je suis le grand capitaine Usopp ! J'ai 8 000 hommes sous mon commandement ! C'est moi qui fait la loi sur cette île ! Je vous préviens, quittez ce village pendant qu'il est encore temps sinon vous aurez à faire à moi et à mes hommes!\"", "usopp.png");
var zoro = new Personnage("Zoro", 1111000000, "Le Chasseur de Pirates", 21, 1.81, "East Blue", "Roronoa Zoro le Chasseur de Pirates est un pirate, un ex-chasseur de pirates et l'un des protagonistes de One Piece.\n\nIl fut le premier membre à rejoindre l'Équipage du Chapeau de Paille, il en est le premier et principal épéiste. Son ambition est de devenir le meilleur sabreur au monde et il a d'ailleurs montré une volonté de fer dans le but d'y parvenir. C'est un maître escrimeur qui peut utiliser plusieurs styles de combat dont la particularité repose sur le nombre d'épées, ses capacités au combat sont telles qu'il donne parfois l'impression aux personnes extérieures à l'équipage d'être le véritable Capitaine.\n\nZoro fait partie des Onze Supernovas avec sa prime de 120 000 000 de berry qu'il a obtenu avant ellipse, il est ainsi l'une des deux personnes du groupe à être Supernova sans pour autant être capitaine d'équipage. Après l'ellipse, suite aux événements de Dressrosa, il possède une prime de 320 000 000 de berry, ce qui en fait la quatrième plus grosse prime de l'équipage. Après les événements de l'Arc Pays des Wa, sa prime monte ensuite à 1.111.000.000 de berry.\n\nIl est né dans East Blue, Zoro étant le fils de Tera et Roronoa Arashi, et le petit-fils de Shimotsuki Furiko et Roronoa Pinzoro, faisant de lui un descendant de la Fami lleShimotsuki du Pays des Wa.", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "zoro.png");
var robin = new Personnage("Robin", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "robin.jpg");
var chopper = new Personnage("Chopper", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "chopper.jpg");
var brook = new Personnage("Brook", 1111000000, "", 21, 1.81, "East Blue", "", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "brook.png");
StubEquipage stubEquipage = new StubEquipage();
StubFruitDuDemon stubFruitDuDemon = new StubFruitDuDemon();
List<FruitDuDemon> fruits = new List<FruitDuDemon>(stubFruitDuDemon.RecupererFruit());
luffy.AjouterFruit(fruits.FirstOrDefault(p => p.Nom == "Fruit de l'humain modèle Nika"));
robin.AjouterFruit(fruits.FirstOrDefault(p => p.Nom == "Fruit des Éclosions"));
List<Personnage> persos = new List<Personnage>()
{
new Personnage("Luffy", 3000000000,"Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy (モンキー・D・ルフィ, Monkī Dī Rufi) est un pirate et le principal protagoniste du manga et anime One Piece. Luffy est le fils du chef de l'Armée Révolutionnaire, Monkey D. Dragon, le petit-fils du célèbre héros de la Marine, Monkey D. Garp, le fils adoptif d'une bandit des montagnes, Curly Dadan ainsi que le frère adoptif du défunt Portgas D. Ace et de Sabo.\n\nSon rêve le plus cher est de devenir le Seigneur des Pirates en trouvant le trésor légendaire One Piece, caché quelque part dans le monde par Gol D. Roger. Selon lui, ce rêve se concrétisera, en devenant la personne la plus libre qui soit. Il a mangé par erreur un Fruit du Démon, le Gomu Gomu no Mi, qui lui permet d'être un homme-élastique, que l'Équipage du Roux avait pris à un convoi du Gouvernement Mondial.\n\n En tant que fondateur et Capitaine de l'Équipage du Chapeau de Paille, il est le premier membre à en faire partie. C'est également le fondateur involontaire de la Grande Flotte du Chapeau de Paille, même s'il refuse cependant d'en être le Capitaine, ne désirant pas priver les autres de leur liberté. ", "\"Le Roi des Pirates, ce sera moi !\"", "luffy.png"),
new Personnage("Nami", 366000000, "Le Chatte Voleuse", 20, 1.70, "East Blue", "Nami, alias La Chatte Voleuse (泥棒猫, Dorobō Neko), est la navigatrice de L'Équipage du Chapeau de Paille. Elle est la deuxième personne à se joindre à l'équipage après Zoro. Elle a brièvement trahi l'Équipage du Chapeau de Paille pendant l'Arc Baratie et les rejoignit officiellement à la fin de l'Arc d'Arlong après que son passé et ses intentions furent révélés. Son rêve est de dessiner une carte complète du monde. Sa prime actuelle s'élève à 366 000 000 berry.", "\"Je n'aime que deux choses, l'argent et les mandarines !!\"", "nami.png"),
new Personnage("Usopp", 500000000,"Dieu Usopp", 19, 1.76, "East Blue", "Usopp (ウソップ, Usoppu), également nommé Pipo dans les anciennes éditions de Glénat du manga, est un membre de L'Équipage du Chapeau de Paille, il occupe le poste de Tireur d'Élite. Il est originaire du Village de Sirop. Bien que n'étant pas Charpentier Naval, il s'occupait également de réparer le Vogue Merry (dont il colmatait les trous avec les moyens du bord). Il est ensuite remplacé par Franky, lorsque ce dernier et le Thousand Sunny rejoignirent l'équipage, pour ce qui est de l'entretien du navire.\n\nLorsquil était au Village de Sirop, il était le Capitaine de l'Équipage du Capitaine Usopp et était connu par les membres de son équipage comme le Capitaine Usopp (船長ウソップ, Kyaputen Usoppu). Il a d'ailleurs gardé ce pseudonyme qui fait partie de ses répliques cultes. Il a dissous l'équipage lorsqu'il est parti en mer et qu'il a rejoint l'Équipage du Chapeau de Paille. Il est le fils de Yasopp, membre de l'Équipage du Roux.\n\nSon rêve est de devenir un valeureux guerrier des mers, et de suivre les traces de son père, et il estime qu'il pourra mourir tranquille lorsqu'il l'aura réalisé. Il pourra alors se dire : \"C'est moi Usopp !! Le preux guerrier des mers!!\".\n\nAlors que sa prime initiale était seulement de 30 000 000 berrys (sous le pseudonyme de Sogeking (そげキング, Sogekingu)) avant l'ellipse, celle-ci a drastiquement augmenté, allant jusqu'à 200 000 000 de berry(sous le pseudonyme de God Usopp (神ウソップ, Goddo Usoppu)) suite aux événements de l'Arc Dressrosa, puis 500.000.000 de berry après les événements de l'Arc Pays des Wa. ", "\"Je suis le grand capitaine Usopp ! J'ai 8 000 hommes sous mon commandement ! C'est moi qui fait la loi sur cette île ! Je vous préviens, quittez ce village pendant qu'il est encore temps sinon vous aurez à faire à moi et à mes hommes!\"", "usopp.png"),
new Personnage("Zoro", 1111000000,"Le Chasseur de Pirates", 21, 1.81, "East Blue", "Roronoa Zoro le Chasseur de Pirates est un pirate, un ex-chasseur de pirates et l'un des protagonistes de One Piece.\n\nIl fut le premier membre à rejoindre l'Équipage du Chapeau de Paille, il en est le premier et principal épéiste. Son ambition est de devenir le meilleur sabreur au monde et il a d'ailleurs montré une volonté de fer dans le but d'y parvenir. C'est un maître escrimeur qui peut utiliser plusieurs styles de combat dont la particularité repose sur le nombre d'épées, ses capacités au combat sont telles qu'il donne parfois l'impression aux personnes extérieures à l'équipage d'être le véritable Capitaine.\n\nZoro fait partie des Onze Supernovas avec sa prime de 120 000 000 de berry qu'il a obtenu avant ellipse, il est ainsi l'une des deux personnes du groupe à être Supernova sans pour autant être capitaine d'équipage. Après l'ellipse, suite aux événements de Dressrosa, il possède une prime de 320 000 000 de berry, ce qui en fait la quatrième plus grosse prime de l'équipage. Après les événements de l'Arc Pays des Wa, sa prime monte ensuite à 1.111.000.000 de berry.\n\nIl est né dans East Blue, Zoro étant le fils de Tera et Roronoa Arashi, et le petit-fils de Shimotsuki Furiko et Roronoa Pinzoro, faisant de lui un descendant de la Famille Shimotsuki du Pays des Wa.", "\"Un coup dans le dos est le déshonneur pour un sabreur !\"", "zoro.png"),
luffy,
nami,
usopp,
zoro,
robin,
chopper,
brook,
};
return perso;
//stubEquipage.ChargerEquipage(persos);
//List<Equipage> equipages = new List<Equipage>(stubEquipage.RecupererEquipage());
//var equip = equipages.Where(p => p.Nom == "Équipage au chapeau de paille");
//luffy.Equipage.AddRange(equip);
//nami.Equipage.AddRange(equip);
//usopp.Equipage.AddRange(equip);
//zoro.Equipage.AddRange(equip);
//robin.Equipage.AddRange(equip);
//brook.Equipage.AddRange(equip);
//chopper.Equipage.AddRange(equip);
//List<Personnage> persos2 = new List<Personnage>()
//{
// luffy,
// nami,
// usopp,
// zoro,
// robin,
// chopper,
// brook,
//};
return persos;
}
}
}

@ -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

@ -1,11 +1,29 @@
namespace Ohara;
using Model.Serializer;
using Model.Stub;
using Model.Managers;
namespace Ohara;
public partial class App : Application
{
public App()
public Manager manager { get; set; } = new Manager(new XML_Serializer(FileSystem.Current.AppDataDirectory));
public App()
{
InitializeComponent();
MainPage = new AppShell();
InitializeComponent();
Routing.RegisterRoute(nameof(PageInfoIle), typeof(PageInfoIle));
Routing.RegisterRoute(nameof(PageInfoBateau), typeof(PageInfoBateau));
Routing.RegisterRoute(nameof(PageInfoBestiaire), typeof(PageInfoBestiaire));
Routing.RegisterRoute(nameof(PageInfoEquipage), typeof(PageInfoEquipage));
Routing.RegisterRoute(nameof(PageInfoFdd), typeof(PageInfoFdd));
Routing.RegisterRoute(nameof(PageInfoPersonnage), typeof(PageInfoPersonnage));
Routing.RegisterRoute(nameof(ModalIle), typeof(ModalIle));
Routing.RegisterRoute(nameof(ModalBestiaire), typeof(ModalBestiaire));
Routing.RegisterRoute(nameof(ModalFDD), typeof(ModalFDD));
Routing.RegisterRoute(nameof(ModalPersonnage), typeof(ModalPersonnage));
Routing.RegisterRoute(nameof(ModalEquipage), typeof(ModalEquipage));
Routing.RegisterRoute(nameof(ModalBateau), typeof(ModalBateau));
MainPage = new AppShell();
}
}

@ -4,17 +4,178 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
Shell.FlyoutBehavior="Flyout"
Shell.NavBarIsVisible="False">
xmlns:icon="clr-namespace:Ohara.Resources"
FlyoutBackgroundColor="White"
Shell.FlyoutBehavior="Locked"
Shell.NavBarIsVisible="False"
>
<Shell.Resources>
<Style TargetType="Layout"
ApplyToDerivedTypes="True"
Class="FlyoutItemLayoutStyle">
<Setter Property="WidthRequest" Value="1000"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
</VisualState.Setters>
</VisualState>
<!--<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#72a3b3"/>
</VisualState.Setters>
</VisualState>-->
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Shell">
<Setter Property="FlyoutBackgroundColor" Value="White"/>
</Style>
<Style TargetType="Label"
ApplyToDerivedTypes="True"
Class="FlyoutItemLayoutStyle">
<Setter Property="WidthRequest" Value="1000"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<!--<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="TextColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="TextColor" Value="White"/>
</VisualState.Setters>
</VisualState>-->
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
</Shell.Resources>
<Shell.TitleView>
<Label/>
</Shell.TitleView>
<Shell.FlyoutHeader >
<Grid HeightRequest="200" BackgroundColor="Black" Margin="0,0,0,20">
<Image Source="ohara2.png" Aspect="Fill" Opacity="0.8" />
<Label Text="Ohara" FontSize="33" TextColor="White" HorizontalOptions="Center" VerticalOptions="Center" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="5" Stroke="#72a3b3" VerticalOptions="End" />
</Grid>
</Shell.FlyoutHeader>
<FlyoutItem Title="Accueil" >
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Acceuil}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:MainPage}" />
</FlyoutItem>
<FlyoutItem Title="Favoris">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Fav}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageFavoris}" />
</FlyoutItem>
<FlyoutItem Title="Personnages">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Perso}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PagePersonnage}" />
</FlyoutItem>
<FlyoutItem Title="Bateaux">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Bateau}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageBateau}" />
</FlyoutItem>
<FlyoutItem Title="Îles" >
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Ile}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageIle}" />
</FlyoutItem>
<FlyoutItem Title="Fruits Du Démon">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Fdd}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageFDD}" />
</FlyoutItem>
<FlyoutItem Title="Equipages">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Equip}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageEquipage}" />
</FlyoutItem>
<ShellContent
ContentTemplate="{DataTemplate local:PageInfoFdd}"
Route="PageInfoFdd" />
<FlyoutItem Title="Bestiaire">
<FlyoutItem.Icon>
<FontImageSource
FontFamily="Icons"
Glyph="{x:Static icon:IconFont.Best}"
Color="#72a3b3"
Size="64"/>
</FlyoutItem.Icon>
<ShellContent ContentTemplate="{DataTemplate local:PageBestiaire}" />
</FlyoutItem>
<Shell.FlyoutFooter>
<StackLayout>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="4" Stroke="#72a3b3"/>
<Label Text="REY Guillaume et BRUGIÈRE Yoan" HorizontalOptions="Center" Margin="10" TextColor="#72a3b3"/>
</StackLayout>
</Shell.FlyoutFooter>
</Shell>

@ -1,9 +1,13 @@
namespace Ohara;
using Model;
public partial class AppShell : Shell
{
public AppShell()
public AppShell()
{
InitializeComponent();
}
}

@ -4,44 +4,56 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.MainPage"
BackgroundColor="#e2edf1">
<ScrollView>
<VerticalStackLayout Spacing="50" Padding="30">
<Grid HeightRequest="500" HorizontalOptions="Center" MaximumWidthRequest="1000" >
<Frame CornerRadius="25"
BorderColor="Transparent"
BackgroundColor="Black"
IsClippedToBounds="True"
Padding="0">
<Image Source="ohara.jpg" Opacity="0.6" Aspect="Fill"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="40" Margin="0,20,0,0">
<Frame CornerRadius="20" WidthRequest="600" HeightRequest="75">
<Label Text="Bienvenue dans Ohara !" FontAttributes="Bold" FontSize="30" HorizontalOptions="Center" TextColor="White"/>
<Frame.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Frame.Background>
</Frame>
<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Start" Margin="20" Spacing="10">
<Label Text="Bienvenue dans Ohara !" FontSize="27" HorizontalTextAlignment="Center" TextColor="White"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="White" />
</VerticalStackLayout>
</Frame>
<Frame CornerRadius="20" BorderColor="#72a3b3" BackgroundColor="#72a3b3" Padding="20" WidthRequest="1000" HeightRequest="500" >
<Label Text="Présentation :" FontAttributes="Bold" FontSize="30" HorizontalOptions="Center" TextColor="White"/>
</Frame>
<Frame CornerRadius="20" BorderColor="#72a3b3" BackgroundColor="#72a3b3" Padding="20" WidthRequest="1200" HeightRequest="500" >
<Label Text="Nouveautés : ..." FontAttributes="Bold" FontSize="30" HorizontalOptions="Start" TextColor="White"/>
</Frame>
<VerticalStackLayout HorizontalOptions="Center" VerticalOptions="Center" Spacing="5">
<Label Text="Inventaire de votre bibliothèque :" TextColor="White" FontSize="17" FontAttributes="Bold"/>
<Label Text="{Binding Personnages.Count, StringFormat=' {0} Personnages'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
<Label Text="{Binding Bateaux.Count, StringFormat=' {0} Bateaux'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
<Label Text="{Binding Iles.Count, StringFormat=' {0} Îles'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
<Label Text="{Binding Fruits.Count, StringFormat=' {0} Fruit du démons'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
<Label Text="{Binding Equipages.Count, StringFormat=' {0} Equipages'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
<Label Text="{Binding Bestiaire.Count, StringFormat=' {0} Bestiaires'}" TextColor="White" FontSize="17" HorizontalTextAlignment="Center"/>
</VerticalStackLayout>
<Label Text="Apprenez-en davantage sur le monde de One Piece et remplissez votre bibliothèque !" TextColor="White" FontSize="17" FontAttributes="Bold" VerticalOptions="End" HorizontalOptions="Center" Margin="20"/>
</Grid>
<VerticalStackLayout Spacing="10">
<Label Text="Présentation de l'application :" FontAttributes="Bold" FontSize="25" VerticalOptions="Start" TextColor="#72a3b3" HorizontalTextAlignment="Center"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label TextColor="#72a3b3" FontSize="17" HorizontalTextAlignment="Center" >
<Label.Text>
Ohara est le nom d'une île dans le manga One Piece, écrit par Eiichiro Oda. Cette île abritait de nombreux archéologues qui cherchaient à déceler les mystères du monde.Nous avons choisi le nom Ohara pour notre projet lié à la SAE 2.01, car notre application représente une véritable encyclopédie rassemblant des informations sur One Piece. Avec des centaines de personnages, des dizaines d'îles et de nombreux arcs d'histoire, il peut être difficile de se souvenir de tous les détails. Notre application a été conçue pour aider les fans à accéder facilement à toutes les informations sur One Piece,en offrant une expérience utilisateur fluide et intuitive.
</Label.Text>
</Label>
<Label TextColor="#72a3b3" FontAttributes="Bold" FontSize="17" HorizontalTextAlignment="Center" Text="Commencez dès maintenant à naviguer dans l'application grâce au menu à gauche ..." />
</VerticalStackLayout>
</VerticalStackLayout>
<<<<<<< HEAD
@ -53,4 +65,8 @@
</Grid>
=======
</ScrollView>
>>>>>>> master
</ContentPage>

@ -1,13 +1,15 @@
using Microsoft.Maui.Platform;
using Model.Managers;
using Plugin.Maui.Audio;
namespace Ohara;
public partial class MainPage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public MainPage()
{
InitializeComponent();
{
InitializeComponent();
BindingContext = manager;
}
}

@ -1,7 +1,11 @@
using Microsoft.Extensions.Logging;
namespace Ohara;
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
@ -12,8 +16,9 @@ public static class MauiProgram
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
});
fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold");
fonts.AddFont("typicons.ttf", "Icons");
});
#if DEBUG
builder.Logging.AddDebug();

@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalBateau"
Title="ModalBateau"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,58 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalBateau : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Bateau nouveauBateau;
public string ancienNom;
public ModalBateau()
{
if (manager.SelectedItem != null)
{
nouveauBateau = manager.SelectedItem as Bateau;
ancienNom = nouveauBateau.Nom;
}
else
{
nouveauBateau = new Bateau("Bateau", " ",0,0," ", " ");
}
InitializeComponent();
BindingContext = nouveauBateau;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierBateau(nouveauBateau, ancienNom);
nouveauBateau = manager.SelectedItem as Bateau;
}
else
{
manager.AjouterBateau(nouveauBateau);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauBateau.Image = stream;
}
}
}

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalBestiaire"
Title="ModalBestiaire"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Origine :" FontAttributes="Bold"/>
<Entry Text="{Binding Origine}" />
</HorizontalStackLayout>
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Carectiristique :" TextColor="White" FontAttributes="Bold" Grid.Row="2"/>
<Editor Text="{Binding Caracteristique}" Grid.Column="1" Grid.Row="2" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,58 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalBestiaire : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Bestiaire nouveauBest;
public string ancienNom;
public ModalBestiaire()
{
if (manager.SelectedItem != null)
{
nouveauBest = manager.SelectedItem as Bestiaire;
ancienNom = nouveauBest.Nom;
}
else
{
nouveauBest = new Bestiaire("Bestiaire", " ", " ", " ");
}
InitializeComponent();
BindingContext = nouveauBest;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierBest(nouveauBest, ancienNom);
nouveauBest = manager.SelectedItem as Bestiaire;
}
else
{
manager.AjouterBest(nouveauBest);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauBest.Image = stream;
}
}
}

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalEquipage"
Title="ModalEquipage"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Région :" FontAttributes="Bold"/>
<Entry Text="{Binding Region}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}" HeightRequest="175">
<HorizontalStackLayout HorizontalOptions="CenterAndExpand">
<CollectionView x:Name="listeCapitaine" SelectionChanged="AjoutCapitaine" SelectionMode="Single" HorizontalOptions="CenterAndExpand">
<CollectionView.Header>
<Label Text="Capitaine :"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout>
<Label Text="{Binding Nom}"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</HorizontalStackLayout>
</Frame>
<Frame x:Name="framePicker" Style="{StaticResource frameModif}" HeightRequest="250">
<HorizontalStackLayout HorizontalOptions="Center">
<ScrollView Orientation="Vertical">
<CollectionView x:Name="listeAllie" ItemsSource="{Binding Equipages}" SelectionChanged="AjoutAllie" SelectionMode="Multiple">
<CollectionView.Header>
<Label Text="Allié(s) :"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout>
<Label Text="{Binding Nom}"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
<ScrollView Orientation="Vertical">
<CollectionView x:Name="listeMembre" ItemsSource="{Binding Personnages}" SelectionChanged="AjoutMembre" SelectionMode="Multiple">
<CollectionView.Header>
<Label Text="Membre(s) :"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout>
<Label Text="{Binding Nom}"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Statut :" FontAttributes="Bold"/>
<Entry Text="{Binding Statut}" />
</HorizontalStackLayout >
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,82 @@
using Model.Classes;
using Model.Managers;
using System.Collections.Generic;
namespace Ohara;
public partial class ModalEquipage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Equipage nouvelEquipage;
public string ancienNom;
public ModalEquipage()
{
if (manager.SelectedItem != null)
{
nouvelEquipage = manager.SelectedItem as Equipage;
ancienNom = nouvelEquipage.Nom;
}
else
{
nouvelEquipage = new Equipage("Equipage", " ", " ", 0,0,true," ");
}
InitializeComponent();
BindingContext = nouvelEquipage;
framePicker.BindingContext = manager;
listeCapitaine.ItemsSource = manager.Personnages;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierEquipage(nouvelEquipage, ancienNom);
nouvelEquipage = manager.SelectedItem as Equipage;
}
else
{
manager.AjouterEquip(nouvelEquipage);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouvelEquipage.Image = stream;
}
}
private void AjoutAllie(object sender, SelectionChangedEventArgs e)
{
if (nouvelEquipage.Allie != null)
nouvelEquipage.ViderAllie();
foreach (var equipage in listeAllie.SelectedItems)
{
nouvelEquipage.AjouterAllie(equipage as Equipage);
}
}
private void AjoutMembre(object sender, SelectionChangedEventArgs e)
{
if (nouvelEquipage.Membre != null)
nouvelEquipage.ViderMembre();
foreach (var perso in listeMembre.SelectedItems)
{
nouvelEquipage.AjouterMembre(perso as Personnage);
}
}
private void AjoutCapitaine(object sender, SelectionChangedEventArgs e)
{
nouvelEquipage.Capitaine = listeCapitaine.SelectedItem as Personnage;
}
}

@ -0,0 +1,74 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalFDD"
Title="ModalFDD"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Type :" FontAttributes="Bold"/>
<Entry Text="{Binding Type}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Forces :" FontAttributes="Bold"/>
<Editor Text="{Binding Forces}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Faiblesses :" FontAttributes="Bold" />
<Editor Text="{Binding Faiblesses}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,57 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalFDD : ContentPage
{
public Manager manager => (App.Current as App).manager;
public FruitDuDemon nouveauFdd;
public string ancienNom;
public ModalFDD()
{
if (manager.SelectedItem != null)
{
nouveauFdd = manager.SelectedItem as FruitDuDemon;
ancienNom = nouveauFdd.Nom;
}
else
{
nouveauFdd = new FruitDuDemon("Fruit", " ", " ",0,0, " "," ","");
}
InitializeComponent();
BindingContext = nouveauFdd;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierFDD(nouveauFdd, ancienNom);
nouveauFdd = manager.SelectedItem as FruitDuDemon;
}
else
{
manager.AjouterFDD(nouveauFdd);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauFdd.Image = stream;
}
}
}

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalIle"
Title="ModalIle"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom Romanise :" FontAttributes="Bold"/>
<Entry Text="{Binding NomRomanise}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Region :" FontAttributes="Bold"/>
<Entry Text="{Binding Region}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Chapitre :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierChap}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Premier Episode :" FontAttributes="Bold"/>
<Entry Text="{Binding PremierEp}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Description :" FontAttributes="Bold"/>
<Editor Text="{Binding Description}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Geographie :" FontAttributes="Bold"/>
<Editor Text="{Binding Geographie}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,59 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalIle : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Ile nouvelIle;
public string ancienNom;
public ModalIle()
{
if(manager.SelectedItem != null)
{
nouvelIle=(Ile)manager.SelectedItem;
ancienNom = manager.SelectedItem.Nom;
}
else
{
this.nouvelIle = new Ile("Ile", "", "", 0, 0, "", "");
}
InitializeComponent();
BindingContext = nouvelIle;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierIle(nouvelIle,ancienNom);
manager.SelectedItem=nouvelIle;
}
else
{
manager.AjouterIle(nouvelIle);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouvelIle.Image = stream;
}
}
}

@ -0,0 +1,102 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.ModalPersonnage"
Title="ModalPersonnage"
BackgroundColor="#e2edf1"
Shell.PresentationMode="ModalAnimated">
<ScrollView>
<FlexLayout AlignItems="End" Wrap="Wrap" Direction="Row" JustifyContent="Center" HorizontalOptions="Center" VerticalOptions="Center" >
<VerticalStackLayout Spacing="4" Margin="2">
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Nom :" FontAttributes="Bold"/>
<Entry Text="{Binding Nom}" WidthRequest="170" Placeholder="Nom de l'objet ..." PlaceholderColor="LightGrey"/>
</HorizontalStackLayout>
</Frame>
<Grid>
<Frame Padding="0" IsClippedToBounds="True">
<Image x:Name="image" Source="{Binding Image}" WidthRequest="300" HeightRequest="300" Grid.Row="2" Grid.Column="1"/>
</Frame>
<Button Text="Choisir une image ..." Clicked="ButtonImage_Clicked" Grid.Row="2" VerticalOptions="End" />
</Grid>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Prime :" FontAttributes="Bold"/>
<Entry Text="{Binding Prime}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Epithete :" FontAttributes="Bold"/>
<Entry Text="{Binding Epithete}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Taille :" FontAttributes="Bold"/>
<Entry Text="{Binding Taille}" />
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Origine :" FontAttributes="Bold"/>
<Entry Text="{Binding Origine}" />
</HorizontalStackLayout >
</Frame>
<Button Text="Annuler" Style="{StaticResource buttonRetirerFavInfo}" Clicked="ButtonAnnuler_Clicked" />
</VerticalStackLayout >
<VerticalStackLayout Spacing="5" Margin="2">
<Frame x:Name="framePicker" Style="{StaticResource frameModif}" HeightRequest="300">
<HorizontalStackLayout HorizontalOptions="Center">
<ScrollView Orientation="Vertical">
<CollectionView x:Name="listeEquipages" ItemsSource="{Binding Equipages}" SelectionChanged="AjoutEquipage" SelectionMode="Single">
<CollectionView.Header>
<Label Text="Equipage :"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout>
<Label Text="{Binding Nom}"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
<ScrollView Orientation="Vertical">
<CollectionView x:Name="listeFruits" ItemsSource="{Binding Fruits}" SelectionChanged="AjoutFruit" SelectionMode="Multiple">
<CollectionView.Header>
<Label Text="Fruit(s) du démon :"/>
</CollectionView.Header>
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout>
<Label Text="{Binding Nom}"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Biographie :" FontAttributes="Bold"/>
<Editor Text="{Binding Biographie}" WidthRequest="300" HeightRequest="200"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameModif}">
<HorizontalStackLayout HorizontalOptions="Center">
<Label Text="Citation :" FontAttributes="Bold"/>
<Editor Text="{Binding Citation}" WidthRequest="300" HeightRequest="150"/>
</HorizontalStackLayout>
</Frame>
<Button Text="Confirmer" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonConfirmer_Clicked" />
</VerticalStackLayout>
</FlexLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,74 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class ModalPersonnage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public Personnage nouveauPerso;
public string ancienNom;
public ModalPersonnage()
{
if (manager.SelectedItem != null)
{
nouveauPerso = manager.SelectedItem as Personnage;
ancienNom = nouveauPerso.Nom;
}
else
{
nouveauPerso = new Personnage("Personnage",0, " ", 0, 0, " ", " ", "");
}
InitializeComponent();
BindingContext = nouveauPerso;
framePicker.BindingContext = manager;
}
private async void ButtonConfirmer_Clicked(object sender, EventArgs e)
{
if (manager.SelectedItem != null)
{
manager.ModifierPerso(nouveauPerso, ancienNom);
nouveauPerso = manager.SelectedItem as Personnage;
}
else
{
manager.AjouterPerso(nouveauPerso);
}
await Navigation.PopModalAsync();
}
private async void ButtonAnnuler_Clicked(object sender, EventArgs e)
{
await Navigation.PopModalAsync();
}
private async void ButtonImage_Clicked(object sender, EventArgs e)
{
var result = await FilePicker.PickAsync(new PickOptions
{
PickerTitle = "Choisissez une image ...",
FileTypes = FilePickerFileType.Images,
});
if (result != null)
{
var stream = result.FullPath;
nouveauPerso.Image = stream;
}
}
private void AjoutEquipage(object sender, SelectionChangedEventArgs e)
{
nouveauPerso.Equipage = listeEquipages.SelectedItem as Equipage;
}
private void AjoutFruit(object sender, SelectionChangedEventArgs e)
{
if (nouveauPerso.Fruit != null)
nouveauPerso.ViderFruit();
foreach(var fruit in listeFruits.SelectedItems)
{
nouveauPerso.AjouterFruit(fruit as FruitDuDemon);
}
}
}

@ -48,6 +48,10 @@
<MauiAsset Include="Resources\Raw\**" LogicalName="%(RecursiveDir)%(Filename)%(Extension)" />
</ItemGroup>
<ItemGroup>
<None Remove="Resources\Fonts\microns.ttf" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="7.0.0" />
<PackageReference Include="Plugin.Maui.Audio" Version="1.0.0" />
@ -58,8 +62,26 @@
</ItemGroup>
<ItemGroup>
<Compile Update="menuBoutons.xaml.cs">
<DependentUpon>menuBoutons.xaml</DependentUpon>
<Compile Update="ModalFDD.xaml.cs">
<DependentUpon>ModalFDD.xaml</DependentUpon>
</Compile>
<Compile Update="ModalBestiaire.xaml.cs">
<DependentUpon>ModalBestiaire.xaml</DependentUpon>
</Compile>
<Compile Update="ModalPersonnage.xaml.cs">
<DependentUpon>ModalPersonnage.xaml</DependentUpon>
</Compile>
<Compile Update="ModalIle.xaml.cs">
<DependentUpon>ModalIle.xaml</DependentUpon>
</Compile>
<Compile Update="ModalEquipage.xaml.cs">
<DependentUpon>ModalEquipage.xaml</DependentUpon>
</Compile>
<Compile Update="ModalBateau.xaml.cs">
<DependentUpon>ModalBateau.xaml</DependentUpon>
</Compile>
<Compile Update="PageFavoris.xaml.cs">
<DependentUpon>PageFavoris.xaml</DependentUpon>
</Compile>
<Compile Update="PageInfoBestiaire.xaml.cs">
<DependentUpon>PageInfoBestiaire.xaml</DependentUpon>
@ -70,9 +92,6 @@
<Compile Update="PageBestiaire.xaml.cs">
<DependentUpon>PageBestiaire.xaml</DependentUpon>
</Compile>
<Compile Update="PageCarte.xaml.cs">
<DependentUpon>PageCarte.xaml</DependentUpon>
</Compile>
<Compile Update="PageBateau.xaml.cs">
<DependentUpon>PageBateau.xaml</DependentUpon>
</Compile>
@ -88,7 +107,25 @@
</ItemGroup>
<ItemGroup>
<MauiXaml Update="menuBoutons.xaml">
<MauiXaml Update="ModalFDD.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalBestiaire.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalPersonnage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalEquipage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="ModalBateau.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageFavoris.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageInfoBateau.xaml">
@ -100,9 +137,6 @@
<MauiXaml Update="PageIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageCarte.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="PageInfoIle.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>

@ -4,86 +4,60 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageBateau"
Title="PageBateau"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="4"/>
<Picker Title="Filtrer" Grid.Column="2" ItemsSource="{Binding Equipages}" ItemDisplayBinding="{Binding Nom}" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}"/>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeBateau" ItemsSource="{Binding Bateaux}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeBateau_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
</Grid.RowDefinitions>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeBateau" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
</Grid.RowDefinitions>
<Frame
<Frame
CornerRadius="25"
BorderColor="#e2edf1"
IsClippedToBounds="True"
Padding="0"
HeightRequest="800"
WidthRequest="450">
<Image
<Image
Source="{Binding Image}"
Aspect="Fill"
/>
</Frame>
</Frame>
<Frame Style="{StaticResource frameObjet2}">
<Frame Style="{StaticResource frameObjet2}">
<StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label
<StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="22"
TextColor="#72a3b3"
HorizontalOptions="Center"
/>
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Label
<Label
Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic"
FontSize="15"
@ -91,15 +65,12 @@
TextDecorations="Underline"
HorizontalOptions="Center"/>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
</Grid>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
</ContentPage>

@ -1,21 +1,52 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageBateau : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageBateau()
{
InitializeComponent();
var manager = new Manager();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeBateau.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bateaux.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
listeBateau.ItemsSource = manager.GetBateaux();
async void listeBateau_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Bateau)listeBateau.SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
}
private async void Button_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalBateau));
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex != -1)
{
listeBateau.ItemsSource = manager.FiltrerBateau(((Equipage)picker.ItemsSource[selectedIndex]).Nom);
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeBateau.SelectedItem = null;
}
}

@ -4,70 +4,43 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageBestiaire"
Title="PageBestiaire"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="20">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
</Grid>
<CollectionView x:Name="listeBest" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate>
<FlexLayout x:Name="listeBest" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Bestiaire}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Frame Style="{StaticResource frameObjet}">
<StackLayout Orientation="Vertical" Padding="5">
<Image
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
<Label
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</Grid>
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Grid>
</ScrollView>
</ContentPage>

@ -1,20 +1,45 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using System.Windows.Input;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageBestiaire : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageBestiaire()
{
InitializeComponent();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listeBest, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Bestiaire.ToList())));
}
searchBar.TextChanged += OnTextChanged;
}
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
Bestiaire SelectedItem = manager.Bestiaire.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
//do something you want
manager.SelectedItem = SelectedItem;
await Navigation.PushAsync(new PageInfoBestiaire());
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeBest, manager.Bestiaire);
}
var manager = new Manager();
listeBest.ItemsSource = manager.GetBestiaires();
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Navigation.PushModalAsync(new ModalBestiaire());
}
}

@ -1,72 +1,42 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageEquipage"
Title="PageEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<ScrollView Grid.Row="0" Grid.Column="1" >
<VerticalStackLayout Spacing="10">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
<CollectionView x:Name="listeEquip" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="25*"/>
</Grid.ColumnDefinitions>
<Frame Style="{StaticResource frameEquip}" >
<StackLayout Orientation="Vertical" Padding="5">
<Image Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
</Grid>
<FlexLayout x:Name="listEquip" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,21 +1,42 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
public partial class PageEquipage : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageEquipage()
{
InitializeComponent();
var manager = new Manager();
listeEquip.ItemsSource = manager.GetEquipages();
}
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listEquip,manager.RechercheObjetOhara(searchBar.Text,new List<ObjetOhara>(manager.Equipages.ToList())));
}
searchBar.TextChanged += OnTextChanged;
private void listeEquip_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
}
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
Equipage SelectedItem = manager.Equipages.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem = SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
}
}
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalEquipage));
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listEquip, manager.Equipages);
}
}

@ -1,103 +1,62 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageFDD"
Title="PageFDD"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="10">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0" x:Name="searchBar" />
<Frame Grid.Column="2" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" >
<Label Text="Filtrer" />
<FlyoutBase.ContextFlyout>
<MenuFlyout >
<MenuFlyoutItem x:Name="Logia" Text="Logia" />
</MenuFlyout>
</FlyoutBase.ContextFlyout>
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="200,*,100,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Picker Title="Filtrer" Grid.Column="2" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>Logia</x:String>
<x:String>Paramecia</x:String>
<x:String>Zoan Carnivore</x:String>
<x:String>Zoan Mythique</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="4"/>
</Grid>
<CollectionView x:Name="listeFDD" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate>
<FlexLayout x:Name="listeFDD" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center"
BindableLayout.ItemsSource="{Binding Fruits}" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Grid Padding="20" >
<Grid.ColumnDefinitions>
<ColumnDefinition Width="33*"/>
</Grid.ColumnDefinitions>
<Frame Style="{StaticResource frameObjet}"
>
<StackLayout Orientation="Vertical" Padding="5">
<Image
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="290"
WidthRequest="290" />
<Label
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
<Label
<Label
VerticalOptions="Center"
HorizontalOptions="Center"
Text="{Binding Type}"
FontAttributes="Italic"
TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</Grid>
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</Grid>
</ScrollView>
</ContentPage>

@ -1,52 +1,67 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
using System.Collections.ObjectModel;
using System.Windows.Input;
public partial class PageFDD : ContentPage
{
public ICommand FiltrerType { get; private set; }
public PageFDD()
{
public Manager manager => (App.Current as App).manager;
public PageFDD()
{
InitializeComponent();
var manager = new Manager();
listeFDD.ItemsSource = manager.GetFruits();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeFDD.ItemsSource = manager.RechercheFDD(searchBar.Text,manager.GetFruits());
BindableLayout.SetItemsSource(listeFDD, manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Fruits.ToList())));
}
searchBar.TextChanged += OnTextChanged;
FiltrerType = new Command((type) => listeFDD.ItemsSource = manager.FiltrerFDD(type.ToString()));
Logia.Command = FiltrerType;
Logia.CommandParameter = "Logia";
searchBar.TextChanged += OnTextChanged;
}
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
FruitDuDemon SelectedItem = manager.Fruits.FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
//do something you want
manager.SelectedItem = SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
}
}
private void MenuFlyoutItem_Clicked(object sender, EventArgs e)
private async void Button_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalFDD));
}
private void Label_Focused(object sender, FocusEventArgs e)
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
else
{
BindableLayout.SetItemsSource(listeFDD, manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList());
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeFDD, manager.Fruits.ToList());
}
}

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="Ohara.PageFavoris"
Title="PageFavoris"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<ScrollView>
<VerticalStackLayout>
<Grid ColumnDefinitions="*" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" HorizontalOptions="Center" WidthRequest="300"/>
</Grid>
<FlexLayout x:Name="listeFav" AlignItems="Center" Wrap="Wrap"
HorizontalOptions="Center" JustifyContent="SpaceEvenly">
<BindableLayout.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="0,10,0,0" >
<Frame.GestureRecognizers>
<TapGestureRecognizer CommandParameter="{Binding Nom}" Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical" Padding="5">
<Image
Source="{Binding Image}"
HeightRequest="280"
WidthRequest="280" />
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="19"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</BindableLayout.ItemTemplate>
</FlexLayout>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -0,0 +1,81 @@
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageFavoris : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageFavoris()
{
InitializeComponent();
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
BindableLayout.SetItemsSource(listeFav, manager.RechercheObjetOhara(searchBar.Text, manager.GetFavoris()));
}
searchBar.TextChanged += OnTextChanged;
}
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
ObjetOhara SelectedItem = manager.GetFavoris().FirstOrDefault(p => p.Nom == (((TappedEventArgs)e).Parameter.ToString()));
if (SelectedItem != null)
{
manager.SelectedItem = SelectedItem;
Type t = manager.SelectedItem.GetType();
if (t.Equals(typeof(Bateau)))
{
await Shell.Current.GoToAsync(nameof(PageInfoBateau));
}
else if (t.Equals(typeof(Equipage)))
{
await Shell.Current.GoToAsync(nameof(PageInfoEquipage));
}
else if (t.Equals(typeof(Personnage)))
{
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
}
else if (t.Equals(typeof(Ile)))
{
await Shell.Current.GoToAsync(nameof(PageInfoIle));
}
else if (t.Equals(typeof(FruitDuDemon)))
{
await Shell.Current.GoToAsync(nameof(PageInfoFdd));
}
else if (t.Equals(typeof(Bestiaire)))
{
await Shell.Current.GoToAsync(nameof(PageInfoBestiaire));
}
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
BindableLayout.SetItemsSource(listeFav, manager.GetFavoris());
}
else
{
// listeFavs.ItemsSource = manager.FiltrerFDD((string)picker.ItemsSource[selectedIndex]).ToList();
}
}
}

@ -4,84 +4,62 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageIle"
Title="PageIle"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<VerticalStackLayout Grid.Row="0" Grid.Column="1" Spacing="40">
<Grid BackgroundColor="#72a3b3" Padding="10" ColumnSpacing="50" >
<Grid.RowDefinitions>
<RowDefinition Height="10*"/>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions >
<ColumnDefinition Width="20*"/>
<ColumnDefinition Width="25*"/>
<ColumnDefinition Width="10*"/>
<ColumnDefinition Width="10*"/>
</Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2">
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeIle" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
</Grid.RowDefinitions>
<Frame
<VerticalStackLayout Spacing="40">
<Grid ColumnDefinitions="200,*,100,10,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." Style="{StaticResource searchBarOhara}" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="Button_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="4"/>
<Picker Title="Filtrer" Grid.Column="2" SelectedIndexChanged="PickerFiltre_SelectedIndexChanged" Style="{StaticResource pickerOhara}" >
<Picker.ItemsSource>
<x:Array Type="{x:Type x:String}">
<x:String>Aucun</x:String>
<x:String>East Blue</x:String>
<x:String>West Blue</x:String>
<x:String>North Blue</x:String>
<x:String>South Blue</x:String>
<x:String>Grand Line</x:String>
</x:Array>
</Picker.ItemsSource>
</Picker>
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeIle" ItemsSource="{Binding Iles}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listeIle_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Grid Padding="50" ColumnSpacing="10">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
</Grid.RowDefinitions>
<Frame
CornerRadius="25"
BorderColor="#e2edf1"
IsClippedToBounds="True"
Padding="0"
HeightRequest="800"
WidthRequest="450">
<Image
<Image
Source="{Binding Image}"
Aspect="Fill"
/>
</Frame>
</Frame>
<Frame Style="{StaticResource frameObjet2}">
<Frame Style="{StaticResource frameObjet2}">
<StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label
<StackLayout Orientation="Vertical" Spacing="25" VerticalOptions="Center">
<Label
Text="{Binding Nom}"
FontAttributes="Bold"
FontSize="22"
TextColor="#72a3b3"
HorizontalOptions="Center"
/>
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Label
<Line X1="0" X2="500" Stroke="#72a3b3" StrokeThickness="2"/>
<Label
Text="Cliquez ici pour voir en détail"
FontAttributes="Bold,Italic"
FontSize="15"
@ -89,15 +67,12 @@
TextDecorations="Underline"
HorizontalOptions="Center"/>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
</Grid>
</StackLayout>
</Frame>
</Grid>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
</ContentPage>

@ -1,23 +1,55 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageIle : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageIle()
{
InitializeComponent();
var manager = new Manager();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listeIle.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Iles.ToList()));
}
searchBar.TextChanged += OnTextChanged;
listeIle.ItemsSource = manager.GetIles();
}
async void listeIle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Ile)listeIle.SelectedItem;
await Shell.Current.GoToAsync(nameof(PageInfoIle));
}
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
private async void Button_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Shell.Current.GoToAsync(nameof(ModalIle));
}
private void PickerFiltre_SelectedIndexChanged(object sender, EventArgs e)
{
var picker = (Picker)sender;
int selectedIndex = picker.SelectedIndex;
if (selectedIndex == 0)
{
listeIle.ItemsSource =manager.Iles.ToList();
}
else
{
listeIle.ItemsSource = manager.FiltrerIle((string)picker.ItemsSource[selectedIndex]);
}
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listeIle.SelectedItem = null;
}
}

@ -1,108 +1,79 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageInfoBateau"
Title="PageInfoBateau"
BackgroundColor="#e2edf1">
<Grid>
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="40">
<CollectionView x:Name="listeBateau">
<CollectionView.ItemTemplate>
<DataTemplate>
<VerticalStackLayout Spacing="10" Padding="40">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="{Binding EstFavori}" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Button x:Name="bouttonAffiliation" Text="{Binding Affiliation.Nom, StringFormat='Affiliation : {0}'}" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonAffiliation_Clicked" ToolTipProperties.Text="Clickez pour en savoir plus..."/>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Affiliation(s) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Affiliation}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
</ScrollView>
</ContentPage>

@ -1,17 +1,58 @@
using Model.Stub;
using Model;
using System.Windows.Input;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageInfoBateau : ContentPage
{
public Manager manager => (App.Current as App).manager;
public PageInfoBateau()
{
InitializeComponent();
Manager manager = new Manager();
if(manager.SelectedItem?.EstFavori==true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
listeBateau.ItemsSource = manager.GetBateaux();
}
BindingContext =manager.SelectedItem;
}
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavBateau((Bateau)manager.SelectedItem,true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
}
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavBateau((Bateau)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void ButtonAffiliation_Clicked(object sender, EventArgs e)
{
Bateau bateau = (Bateau)manager.SelectedItem;
manager.SelectedItem = bateau.Affiliation;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBateau((Bateau)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalBateau), true);
}
}

@ -5,86 +5,64 @@
x:Class="Ohara.PageInfoBestiaire"
Title="PageInfoBestiaire"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="40">
<CollectionView x:Name="listeBest">
<CollectionView.ItemTemplate>
<DataTemplate>
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</ScrollView>
</Grid>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,18 +1,47 @@
using Model.Stub;
using Model;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageInfoBestiaire : ContentPage
{
public PageInfoBestiaire()
public Manager manager => (App.Current as App).manager;
public PageInfoBestiaire()
{
InitializeComponent();
var manager = new Manager();
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
}
BindingContext = manager.SelectedItem;
listeBest.ItemsSource = manager.GetBestiaires();
}
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
}
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavBest((Bestiaire)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerBest((Bestiaire)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalBestiaire), true);
}
}

@ -4,103 +4,158 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageInfoEquipage"
Title="PageInfoEquipage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300" />
<ColumnDefinition Width="90*" />
</Grid.ColumnDefinitions>
<local:menuBoutons WidthRequest="300" Grid.Column="0"/>
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="40">
<CollectionView x:Name="listeEquip">
<CollectionView.ItemTemplate>
<DataTemplate>
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Membre(s)" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="3 - Allié(s)" TextColor="#72a3b3"/>
</Frame>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame BorderColor="#72a3b3">
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
Aspect="AspectFit"
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Membre(s)" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="3 - Allié(s)" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame BorderColor="#72a3b3">
<Image
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
Aspect="AspectFit"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Region :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Statut :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Statut}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Region :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Statut :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Statut}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Grid ColumnDefinitions="75*,25*" ColumnSpacing="10">
<VerticalStackLayout Spacing="5">
<Label Text="Membre(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<ScrollView Orientation="Horizontal">
<CollectionView x:Name="listMembre" ItemsLayout="HorizontalList" ItemsSource="{Binding Membre}" EmptyView="Cet équipage n'à pas de membres..." SelectionMode="Single" SelectionChanged="listMembre_SelectionChanged" >
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Membre(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Membre}" TextColor="#72a3b3" />
<Label Text="Allié(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Allie}" TextColor="#72a3b3" />
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="5">
<Label Text="Capitaine :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
<Frame BindingContext="{Binding Capitaine}" Style="{StaticResource frameObjet}" HorizontalOptions="Center" Margin="5">
<Frame.GestureRecognizers>
<TapGestureRecognizer Tapped="TapGestureRecognizer_Tapped"/>
</Frame.GestureRecognizers>
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Allié(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<CollectionView x:Name="listAlle" ItemsLayout="HorizontalList" ItemsSource="{Binding Allie}" EmptyView="Cet équipage n'à pas d'alliés..." SelectionMode="Single" SelectionChanged="listAlle_SelectionChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameEquip}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="White"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,19 +1,73 @@
using Model.Stub;
using Model;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageInfoEquipage : ContentPage
{
public PageInfoEquipage()
public Manager manager => (App.Current as App).manager;
public PageInfoEquipage()
{
InitializeComponent();
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
}
BindingContext = manager.SelectedItem;
}
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavEquip((Equipage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajout<75> au favoris";
retirerFav.IsVisible = true;
}
var manager = new Manager();
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavEquip((Equipage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void listMembre_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem=(Personnage)listMembre.SelectedItem;
await Navigation.PushAsync(new PageInfoPersonnage());
}
private async void listAlle_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Equipage)listAlle.SelectedItem;
await Navigation.PushAsync(new PageInfoEquipage());
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerEquip((Equipage)manager.SelectedItem);
await Navigation.PopAsync();
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
listAlle.SelectedItem=null;
listMembre.SelectedItem=null;
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalEquipage), true);
}
listeEquip.ItemsSource = manager.GetEquipages();
private async void TapGestureRecognizer_Tapped(object sender, TappedEventArgs e)
{
manager.SelectedItem = manager.SelectedItem as Personnage;
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
}
}

@ -5,8 +5,8 @@
x:Class="Ohara.PageInfoFdd"
Title="PageInfoFdd"
BackgroundColor="#e2edf1">
<Grid>
<<<<<<< HEAD
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
@ -51,66 +51,91 @@
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Image
=======
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40" >
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="45*"/>
<ColumnDefinition Width="45*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="2" Padding="5">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire :" Style="{StaticResource titreInfo}" />
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Label Text="1 Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Label Text="2 Force/Faiblesses" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Label Text="3 Utilisateurs" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="2" Padding="5">
<Frame Style="{StaticResource frameInfo}" >
<Label Text="{Binding Nom}" HorizontalOptions="Center" Style="{StaticResource titreInfo}" />
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Image
>>>>>>> master
Source="{Binding Image}"
HeightRequest="250"
WidthRequest="250"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Nom romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Type :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Type}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Premier apparition (chapitre) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Premier apparition (episode) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Nom romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Type :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Type}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Premier apparition (chapitre) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<HorizontalStackLayout Spacing="5" HorizontalOptions="Center">
<Label Text="Premier apparition (episode) :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</HorizontalStackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="{Binding Description}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Force / Faiblesses :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Grid ColumnSpacing="20" Padding="7">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="50*"/>
<ColumnDefinition Width="50*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Grid.Row="0">
<Label Text="Forces :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Grid.Row="0">
<Label Text="Faiblesses :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
</Grid>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
<Label Text="Description :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="{Binding Description}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Utilisateurs :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="Force / Faiblesses :" Style="{StaticResource titreInfo}"/>
<Line Stroke="#72a3b3" StrokeThickness="2" X1="0" X2="3000"/>
<Label Text="Forces :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Forces}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Faiblesses :" Style="{StaticResource titreInfo}" />
<Label Text="{Binding Faiblesses}" Style="{StaticResource paragrapheInfo}"/>
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,16 +1,52 @@
using Model;
using Model.Classes;
using Model.Stub;
using Model.Managers;
namespace Ohara;
public partial class PageInfoFdd : ContentPage
{
public PageInfoFdd()
public Manager manager => (App.Current as App).manager;
public PageInfoFdd()
{
InitializeComponent();
var manager = new Manager();
listObj.ItemsSource = manager.GetFruits();
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
BindingContext = manager.SelectedItem;
}
<<<<<<< HEAD
=======
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavFDD((FruitDuDemon)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerFDD((FruitDuDemon)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalFDD), true);
}
>>>>>>> master
}

@ -3,10 +3,9 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageInfoIle"
Title="PageInfoIle"
BackgroundColor="#e2edf1">
<Grid>
<<<<<<< HEAD
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
@ -49,60 +48,78 @@
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
=======
<ScrollView Grid.Row="0" Grid.Column="1" Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnSpacing="20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="40*"/>
<ColumnDefinition Width="40*"/>
</Grid.ColumnDefinitions>
<VerticalStackLayout Grid.Column="0" Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Description" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Caracteristiques" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="SpaceEvenly" >
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}" >
<Image
>>>>>>> master
Source="{Binding Image}"
HeightRequest="200"
WidthRequest="300"
/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Région :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Caracteristiques :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Caracteristique}" TextColor="#72a3b3" />
</VerticalStackLayout>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
</Grid>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Nom Romanisé :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding NomRomanise}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Région :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Region}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition manga :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierChap}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Première apparition anime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding PremierEp}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</Grid>
<Label Text="Description :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Description}" TextColor="#72a3b3" />
<Label Text="Géographie :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Geographie}" TextColor="#72a3b3" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

@ -1,18 +1,53 @@
using Model.Stub;
using Model;
using Model.Classes;
using Model.Managers;
namespace Ohara;
public partial class PageInfoIle : ContentPage
{
public PageInfoIle()
public Manager manager => (App.Current as App).manager;
public PageInfoIle()
{
InitializeComponent();
Manager manager = new Manager();
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
BindingContext = manager.SelectedItem;
listeIle.ItemsSource = manager.GetIles();
}
<<<<<<< HEAD
=======
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavIle((Ile)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavIle((Ile)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerIle((Ile)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalIle), true);
}
>>>>>>> master
}

@ -4,9 +4,10 @@
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PageInfoPersonnage"
Title="PageInfoPersonnage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<<<<<<< HEAD
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
@ -126,4 +127,119 @@
</VerticalStackLayout>
</ScrollView>
</Grid>
=======
<ScrollView Orientation="Vertical" VerticalScrollBarVisibility="Always">
<VerticalStackLayout Spacing="10" Padding="40">
<Grid ColumnDefinitions="40*,40*" ColumnSpacing="30">
<VerticalStackLayout Spacing="4">
<Button x:Name="bouttonFav" Text="Ajouter aux favoris" Style="{StaticResource buttonFavsInfo}" Clicked="AjouterFav_Clicked" />
<Button x:Name="retirerFav" Text="Retirer des favoris" IsVisible="false" Style="{StaticResource buttonRetirerFavInfo}" Clicked="RetirerFav_Clicked"/>
<Frame Style="{StaticResource frameInfo}">
<Label Text="Sommaire" Style="{StaticResource titreInfo}"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="1 - Biographie" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="2 - Citation" TextColor="#72a3b3"/>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<Label Text="3 - Fruit(s)" TextColor="#72a3b3"/>
</Frame>
<FlexLayout AlignItems="Start" Wrap="NoWrap" Direction="Row" JustifyContent="SpaceEvenly" HorizontalOptions="Start">
<Button Text="Supprimer" Style="{StaticResource buttonRetirerFavInfo}" Clicked="Supprimer_Clicked" FlexLayout.Basis="49.5%"/>
<Button Text="Modifier" Style="{StaticResource buttonFavsInfo}" Clicked="Modifier_Clicked" FlexLayout.Basis="49.5%"/>
</FlexLayout>
</VerticalStackLayout>
<VerticalStackLayout Grid.Column="1" Spacing="4">
<Frame Style="{StaticResource frameInfo}">
<Label Style="{StaticResource titreInfo}" Text="{Binding Nom}" HorizontalOptions="Center"/>
</Frame>
<FlexLayout HorizontalOptions="Center" AlignItems="Start" Wrap="Wrap" Direction="Row" JustifyContent="Start" >
<Frame CornerRadius="25"
BorderColor="#e2edf1"
IsClippedToBounds="True"
Padding="0"
HeightRequest="400"
>
<Image
Source="{Binding Image}"
Aspect="AspectFit"
/>
</Frame>
<VerticalStackLayout Spacing="4">
<Button x:Name="bouttonAffiliation" Text="{Binding Equipage.Nom, StringFormat='Equipage : {0}'}" Style="{StaticResource buttonFavsInfo}" Clicked="ButtonAffiliation_Clicked" ToolTipProperties.Text="Clickez pour en savoir plus..." FontSize="15"/>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Prime :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Prime}" TextColor="#72a3b3"/>
<Label Text="berrys" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Épithète :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Epithete}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Âge :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Age}" TextColor="#72a3b3"/>
<Label Text="ans" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Taille :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Taille}" TextColor="#72a3b3"/>
<Label Text="mètres" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
<Frame Style="{StaticResource frameInfo}">
<StackLayout HorizontalOptions="Center" Orientation="Horizontal" Spacing="5">
<Label Text="Origine :" TextColor="#72a3b3" FontAttributes="Bold"/>
<Label Text="{Binding Origine}" TextColor="#72a3b3"/>
</StackLayout>
</Frame>
</VerticalStackLayout>
</FlexLayout>
</VerticalStackLayout>
</Grid>
<Label Text="Biographie :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Biographie}" Style="{StaticResource paragrapheInfo}"/>
<Label Text="Citation(s) :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<Label Text="{Binding Citation}" Style="{StaticResource citationPerso}" />
<Label Text="Fruit :" TextColor="#72a3b3" FontSize="20" FontAttributes="Bold"/>
<Line X1="0" Y1="0" X2="3000" Y2="0" StrokeThickness="2" Stroke="#72a3b3" />
<CollectionView x:Name="listFruit" ItemsLayout="HorizontalList" ItemsSource="{Binding Fruit}" SelectionMode="Single" SelectionChanged="listFruit_SelectionChanged">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Style="{StaticResource frameObjet}" Margin="5">
<StackLayout Orientation="Vertical">
<Image Source="{Binding Image}"
HeightRequest="175"
WidthRequest="175"/>
<Label
HorizontalOptions="Center"
VerticalOptions="Start"
HorizontalTextAlignment="Center"
Text="{Binding Nom}"
FontSize="15"
TextColor="#72a3b3"
FontAttributes="Bold" />
</StackLayout>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</VerticalStackLayout>
</ScrollView>
>>>>>>> master
</ContentPage>

@ -1,18 +1,79 @@
using Model.Stub;
using Model;
using Plugin.Maui.Audio;
using Model.Managers;
using Model.Classes;
namespace Ohara;
public partial class PageInfoPersonnage : ContentPage
{
public PageInfoPersonnage()
public Manager manager => (App.Current as App).manager;
public PageInfoPersonnage()
{
InitializeComponent();
Manager manager = new Manager();
if (manager.SelectedItem?.EstFavori == true)
{
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
if (((Personnage)manager.SelectedItem).Equipage == null)
bouttonAffiliation.IsVisible = false;
BindingContext = manager.SelectedItem;
<<<<<<< HEAD
listePerso.ItemsSource = manager.GetPersonnages();
}
=======
}
private void AjouterFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavPerso((Personnage)manager.SelectedItem, true);
bouttonFav.IsEnabled = false;
bouttonFav.Text = "Ajouté au favoris";
retirerFav.IsVisible = true;
}
private void RetirerFav_Clicked(object sender, EventArgs e)
{
manager.ModifierFavPerso((Personnage)manager.SelectedItem, false);
bouttonFav.IsEnabled = true;
bouttonFav.Text = "Ajouter au favoris";
retirerFav.IsVisible = false;
}
private async void listFruit_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (FruitDuDemon)listFruit.SelectedItem;
await Navigation.PushAsync(new PageInfoFdd());
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
listFruit.SelectedItem = null;
}
private async void Supprimer_Clicked(object sender, EventArgs e)
{
manager.SupprimerPerso((Personnage)manager.SelectedItem);
await Navigation.PopAsync();
}
private async void Modifier_Clicked(object sender, EventArgs e)
{
await Shell.Current.GoToAsync(nameof(ModalPersonnage), true);
}
private async void ButtonAffiliation_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = (manager.SelectedItem as Personnage).Equipage;
await Navigation.PushAsync(new PageInfoEquipage());
}
>>>>>>> master
}

@ -3,10 +3,18 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:local="clr-namespace:Ohara"
x:Class="Ohara.PagePersonnage"
Title="PagePersonnage"
Appearing="ContentPage_Appearing"
BackgroundColor="#e2edf1">
<Grid>
<VerticalStackLayout Spacing="10">
<Grid ColumnDefinitions="200,*,150" BackgroundColor="#72a3b3" Padding="10">
<SearchBar x:Name="searchBar" Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0"/>
<Button Text="Ajouter" Clicked="ButtonAjouter_Clicked" Style="{StaticResource buttonBarre}" Grid.Column="2"/>
<<<<<<< HEAD
<Grid.RowDefinitions>
<RowDefinition Height="2*" />
</Grid.RowDefinitions>
@ -43,6 +51,12 @@
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
=======
</Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsSource="{Binding Personnages}" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé." SelectionMode="Single" SelectionChanged="listePerso_SelectionChanged">
>>>>>>> master
<CollectionView.ItemTemplate>
<DataTemplate>
@ -51,7 +65,7 @@
<ColumnDefinition Width="400"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="750"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Frame CornerRadius="25"
@ -95,20 +109,6 @@
</CollectionView.ItemTemplate>
</CollectionView>
</ScrollView>
</VerticalStackLayout>
<!--<Rectangle WidthRequest="200" HeightRequest="300" HorizontalOptions="Start" BackgroundColor="#72a3b3">
<Rectangle.Fill>
<LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
<GradientStop Color="#cdffd8" Offset="0.0" />-->
<!--<GradientStop Color="#94b9ff" Offset="1.0" /></LinearGradientBrush></Rectangle.Fill></Rectangle>-->
</Grid>
</VerticalStackLayout>
</ContentPage>

@ -1,19 +1,51 @@
namespace Ohara;
using Model;
using Model.Classes;
using Model.Managers;
using Model.Stub;
using Plugin.Maui.Audio;
public partial class PagePersonnage : ContentPage
{
<<<<<<< HEAD
=======
public Manager manager => (App.Current as App).manager;
>>>>>>> master
public PagePersonnage()
{
InitializeComponent();
var manager = new Manager();
BindingContext = manager;
void OnTextChanged(object sender, EventArgs e)
{
SearchBar searchBar = (SearchBar)sender;
listePerso.ItemsSource = manager.RechercheObjetOhara(searchBar.Text, new List<ObjetOhara>(manager.Personnages.ToList()));
}
searchBar.TextChanged += OnTextChanged;
}
async void listePerso_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.CurrentSelection.Count == 0) return;
manager.SelectedItem = (Personnage)listePerso.SelectedItem;
<<<<<<< HEAD
listePerso.ItemsSource = manager.GetPersonnages();
=======
await Shell.Current.GoToAsync(nameof(PageInfoPersonnage));
}
private void ContentPage_Appearing(object sender, EventArgs e)
{
manager.SelectedItem = null;
listePerso.SelectedItem = null;
}
private async void ButtonAjouter_Clicked(object sender, EventArgs e)
{
manager.SelectedItem = null;
await Navigation.PushModalAsync(new ModalPersonnage());
>>>>>>> master
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 788 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Ohara.Resources
{
static class IconFont
{
public const string Fdd = "\ue104";
public const string Equip = "\ue074";
public const string Bateau = "\ue003";
public const string Acceuil = "\ue08a";
public const string Best = "\ue083";
public const string Perso = "\ue12c";
public const string Ile = "\ue081";
public const string Fav = "\ue109";
}
}

@ -402,114 +402,22 @@
<Setter Property="SelectedTabColor" Value="{AppThemeBinding Light={StaticResource Gray950}, Dark={StaticResource Gray200}}" />
</Style>
<Style TargetType="Button" x:Key="buttonMenu">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="250"/>
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="WidthRequest" Value="250"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="WidthRequest" Value="275" />
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Button" x:Key="buttonMenu2">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="1.0" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="CornerRadius" Value="0"/>
<Setter Property="WidthRequest" Value="275" />
</Style>
<Style TargetType="Label" x:Key="titreInfo">
<Setter Property="FontFamily" Value="OpenSans"/>
<Setter Property="FontAttributes" Value="Bold" />
<Setter Property="FontSize" Value="20"/>
<Setter Property="TextColor" Value="#72a3b3"/>
</Style>
<Style TargetType="Frame" x:Key="frameInfo">
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
</Style>
<Style x:Key="RespCollection"
TargetType="CollectionView">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Petit">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="0" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="VerticalGrid, 1" />
<Setter Property="BackgroundColor"
Value="Green"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Moyen">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="480" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="VerticalGrid, 2" />
<Setter Property="BackgroundColor"
Value="Blue"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Grand">
<VisualState.StateTriggers>
<AdaptiveTrigger MinWindowWidth="900" />
</VisualState.StateTriggers>
<VisualState.Setters>
<Setter Property="ItemsLayout"
Value="HorizontalList" />
<Setter Property="BackgroundColor"
Value="Red"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
<Style TargetType="Frame" x:Key="frameModif">
<Setter Property="BackgroundColor" Value="#72a3b3"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
</Style>
<Style x:Key="frameObjet" TargetType="Frame">
@ -603,5 +511,178 @@
<Setter Property="FontSize" Value="15"/>
<Setter Property="Padding" Value="7"/>
</Style>
<Style TargetType="Button" x:Key="buttonFavsInfo">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="BorderColor" Value="#72a3b3"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="0.5" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="TextColor" Value="White"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="Transparent"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Disabled">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Grey"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Button" x:Key="buttonRetirerFavInfo">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
<Setter Property="TextColor" Value="Red"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="Red"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="Red"/>
<Setter Property="TextColor" Value="White"/>
<Setter Property="FontSize" Value="20"/>
<Setter Property="Padding" Value="17"/>
<Setter Property="BorderColor" Value="Red"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<!--<Style TargetType="Label"
Class="FlyoutItemLabelStyle">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="Selected">
<VisualState.Setters>
<Setter Property="TextColor" Value="Black"/>
<Setter Property="FontSize" Value="15"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style TargetType="Layout"
Class="FlyoutItemLayoutStyle"
ApplyToDerivedTypes="True">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="White"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>-->
<Style TargetType="Picker" x:Key="pickerOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="TitleColor" Value="White"/>
</Style>
<Style TargetType="SearchBar" x:Key="searchBarOhara">
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
</Style>
<Style TargetType="Button" x:Key="buttonBarre">
<Setter Property="VisualStateManager.VisualStateGroups">
<VisualStateGroupList>
<VisualStateGroup>
<VisualState x:Name="Normal">
<VisualState.Setters>
<Setter Property="BackgroundColor" Value="#bfe5ef"/>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
<VisualState x:Name="PointerOver">
<VisualState.Setters>
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="1,1">
<GradientStop Color="#cdffd8" Offset="0.1" />
<GradientStop Color="#94b9ff" Offset="0.8" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="TextColor" Value="#72a3b3"/>
<Setter Property="FontAttributes" Value="Bold"/>
</VisualState.Setters>
</VisualState>
</VisualStateGroup>
</VisualStateGroupList>
</Setter>
</Style>
<Style x:Key="InvalidEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="Red" />
</Style>
<Style x:Key="ValidEntryStyle" TargetType="Entry">
<Setter Property="TextColor" Value="Green" />
</Style>
</ResourceDictionary>

@ -1,17 +1,142 @@
// See https://aka.ms/new-console-template for more information
using Model;
using Model.Classes;
using Model.Serializer;
using Model.Managers;
using System.Collections.ObjectModel;
var manager = new Manager();
var xml = new XML_Serializer();
// Tests fonctionnels :
Manager manager = new Manager(new XML_Serializer());
//Tests paramètres du manager :
foreach (Bateau b in manager.Bateaux)
{
Console.WriteLine(b);
}
xml.SetPersonnage(manager.GetPersonnages().ToList());
xml.SetFDD(manager.GetFruits().ToList());
xml.SetBateau(manager.GetBateaux().ToList());
xml.SetBestiaire(manager.GetBestiaires().ToList());
xml.SetEquipage(manager.GetEquipages().ToList());
xml.SetIle(manager.GetIles().ToList());
foreach (Bestiaire b in manager.Bestiaire)
{
Console.WriteLine(b);
}
foreach (Equipage e in manager.Equipages)
{
Console.WriteLine(e);
}
foreach (FruitDuDemon f in manager.Fruits)
{
Console.WriteLine(f);
}
foreach (Personnage p in manager.Personnages)
{
Console.WriteLine(p);
}
Console.WriteLine("\n");
Console.WriteLine("\n");
foreach (Bateau b in manager.Bateaux)
{
manager.ModifierFavBateau(b, false);
}
//Tests serialization :
XML_Serializer serializer = new XML_Serializer();
//Affichage d'un objet à son état initiale
Console.WriteLine(manager.Bateaux[0]);
//Modification de cet objet
manager.ModifierFavBateau(manager.Bateaux[0], true);
Console.WriteLine(manager.Bateaux[0]);
//Serialization de la liste contenant l'objet
serializer.SetBateau(manager.Bateaux.ToList());
//Netoyage de la liste
manager.Bateaux.Clear();
//Deserialization dans la liste
manager.Bateaux = new ObservableCollection<Bateau>(serializer.GetBateaux());
//Affichage de l'objet précedement modifié
Console.WriteLine(manager.Bateaux[0]);
Console.WriteLine("\n");
Console.WriteLine("\n");
//Tests méthode du manager :
foreach (Bateau b in manager.Bateaux)
{
manager.ModifierFavBateau(b, false);
}
//Ajout d'un objet en favoris
manager.ModifierFavBateau(manager.Bateaux[0],true);
foreach (ObjetOhara o in manager.GetFavoris())
{
Console.WriteLine(o.Nom);
}
//Suppréssion d'un objet des favoris
manager.ModifierFavBateau(manager.Bateaux[0], false);
foreach (ObjetOhara o in manager.GetFavoris())
{
Console.WriteLine(o.Nom);
}
Console.WriteLine("\n");
Console.WriteLine("\n");
// Filtre des fruits du démon pour afficher seulement les type "Logia"
foreach (FruitDuDemon f in manager.FiltrerFDD("Logia"))
{
Console.WriteLine(f.Nom+" "+f.Type);
}
Console.WriteLine("\n");
Console.WriteLine("\n");
// Recherche dansune liste de fruit de démon pour afficher les fruits correspondant au mot clé "Nika"
foreach (FruitDuDemon f in manager.RechercheObjetOhara("Nika", new List<ObjetOhara>(manager.Fruits)))
{
Console.WriteLine(f.Nom);
}
Console.WriteLine("\n");
Console.WriteLine("\n");
foreach (Bateau b in manager.Bateaux)
{
manager.ModifierFavBateau(b,true);
}
// Recherche dansune liste de objet ohara pour afficher les objets ohara correspondant au mot clé "Sunny"
foreach (ObjetOhara o in manager.RechercheObjetOhara("Sunny", manager.GetFavoris()))
{
Console.WriteLine(o.Nom);
}
Console.WriteLine("\n");
Console.WriteLine("\n");
ObservableCollection<Bateau> bateaux = new ObservableCollection<Bateau>(manager.GetBateaux());
foreach(Bateau b in bateaux)
{
Console.WriteLine(b);
}
ObservableCollection<Bestiaire> bestiaire = new ObservableCollection<Bestiaire>(manager.GetBestiaires());
foreach (Bestiaire b in bestiaire)
{
Console.WriteLine(b);
}
ObservableCollection<Equipage> equipage = new ObservableCollection<Equipage>(manager.GetEquipages());
foreach (Equipage e in equipage)
{
Console.WriteLine(e);
}
ObservableCollection<FruitDuDemon> fruits = new ObservableCollection<FruitDuDemon>(manager.GetFruits());
foreach (FruitDuDemon f in fruits)
{
Console.WriteLine(f);
}
ObservableCollection<Personnage> personnages = new ObservableCollection<Personnage>(manager.GetPersonnages());
foreach (Personnage p in personnages)
{
Console.WriteLine(p);
}

@ -0,0 +1,39 @@
using Model.Classes;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubBateauTests
{
[Fact]
public void RecupererBateau_ReturnsBateauxList()
{
StubBateau stubBateau = new StubBateau();
IEnumerable<Bateau> result = stubBateau.RecupererBateau();
Assert.True(result!=null,"RecupererBateau n'est pas cencé renvoyé de valeur null.");
Assert.True(result.Any(), "RecupererBateau n'est pas cencé renvoyé une liste vide.");
}
[Fact]
public void RecupererBateau_ReturnsBateauxWithCorrectProperties()
{
StubBateau stubBateau = new StubBateau();
IEnumerable<Bateau> result = stubBateau.RecupererBateau();
foreach (Bateau bateau in result)
{
Assert.False(string.IsNullOrEmpty(bateau.Nom), "Les objets de types bateaux renvoyés par la méthode RecupererBateau doivent etre correctement définit.");
Assert.False(string.IsNullOrEmpty(bateau.Description), "Les objets de types bateaux renvoyés par la méthode RecupererBateau doivent etre correctement définit.");
Assert.False(string.IsNullOrEmpty(bateau.Image), "Les objets de types bateaux renvoyés par la méthode RecupererBateau doivent etre correctement définit.");
Assert.NotNull(bateau.Affiliation);
Assert.True(bateau.PremierChap > 0);
Assert.True(bateau.PremierEp > 0);
}
}
}
}

@ -0,0 +1,48 @@
using Model.Classes;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubBestiaireTests
{
[Fact]
public void RecupererBestiaire_ReturnsBestiaireList()
{
// Arrange
StubBestiaire stubBestiaire = new StubBestiaire();
// Act
IEnumerable<Bestiaire> result = stubBestiaire.RecupererBestiaire();
// Assert
Assert.True(result != null, "RecupererBestiaire n'est pas cencé renvoyé de valeur null.");
Assert.True(result.Any(), "RecupererBestiaire n'est pas cencé renvoyé une liste vide.");
}
[Fact]
public void RecupererBestiaire_BestiaireHaveValidProperties()
{
// Arrange
StubBestiaire stubBestiaire = new StubBestiaire();
// Act
IEnumerable<Bestiaire> result = stubBestiaire.RecupererBestiaire();
// Assert
foreach (Bestiaire bestiaire in result)
{
Assert.NotNull(bestiaire.Nom);
Assert.NotNull(bestiaire.Origine);
Assert.NotNull(bestiaire.Description);
Assert.NotNull(bestiaire.Caracteristique);
Assert.NotNull(bestiaire.Image);
}
}
}
}

@ -0,0 +1,96 @@
using Model.Classes;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubEquipageTests
{
[Fact]
public void ChargerEquipage_CreatesEquipagesList()
{
// Arrange
StubEquipage stubEquipage = new StubEquipage();
List<Personnage> persos = new List<Personnage>();
// Act
stubEquipage.ChargerEquipage(persos);
List<Equipage> equipages = stubEquipage.Equipages;
// Assert
Assert.NotNull(equipages);
Assert.True(equipages != null);
}
[Fact]
public void ChargerEquipage_FillsEquipageMembers()
{
// Arrange
StubEquipage stubEquipage = new StubEquipage();
List<Personnage> persos = new List<Personnage>
{
new Personnage("Luffy",0,"",0,0,"","",""),
new Personnage("Zoro", 0, "", 0, 0, "", "", ""),
new Personnage("Nami", 0, "", 0, 0, "", "", "")
};
// Act
stubEquipage.ChargerEquipage(persos);
List<Equipage> equipages = stubEquipage.Equipages;
// Assert
Assert.NotNull(equipages);
Assert.True(equipages != null);
Equipage? paille = equipages.FirstOrDefault(e => e.Nom == "Équipage au chapeau de paille");
Assert.NotNull(paille);
Assert.True(paille.Membre != null);
Assert.True(1 == paille.Membre.Count);
}
[Fact]
public void RecupererEquipage_ReturnsEquipagesList()
{
StubEquipage stubEquipage = new StubEquipage();
List<Personnage> persos = new List<Personnage>
{
new Personnage("Luffy", 0, "", 0, 0, "", "", ""),
new Personnage("Zoro", 0, "", 0, 0, "", "", ""),
new Personnage("Nami", 0, "", 0, 0, "", "", "")
};
stubEquipage.ChargerEquipage( persos); ;
List<Equipage> result = stubEquipage.RecupererEquipage().ToList();
Assert.NotNull(result);
}
[Fact]
public void RemplirEquipage_AddsMembersToEquipage()
{
// Arrange
StubEquipage stubEquipage = new StubEquipage();
Equipage equipage = new Equipage("TestEquipage", "Test", "Test", 1, 1, true, "Test", "test.png");
List<Personnage> persos = new List<Personnage>
{
new Personnage("Luffy", 0, "", 0, 0, "", "", ""),
new Personnage("Zoro", 0, "", 0, 0, "", "", ""),
new Personnage("Nami", 0, "", 0, 0, "", "", "")
};
List<string> noms = new List<string> { "Luffy", "Zoro" };
// Act
Equipage result = stubEquipage.RemplirEquipage(equipage, persos, noms);
// Assert
Assert.NotNull(result);
Assert.True(result.Membre != null);
Assert.True(2 == result.Membre.Count);
}
}
}

@ -0,0 +1,20 @@
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubFruitDuDemonTests
{
[Fact]
public void RecupererFruit_ReturnsListOfFruits()
{
var stubFruitDuDemon = new StubFruitDuDemon();
var fruits = stubFruitDuDemon.RecupererFruit();
Assert.NotNull(fruits);
}
}
}

@ -0,0 +1,42 @@
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubIleTests
{
[Fact]
public void RecupererIle_ReturnsIleList()
{
// Arrange
var stubIle = new StubIle();
// Act
var iles = stubIle.RecupererIle();
// Assert
Assert.NotNull(iles);
}
[Fact]
public void RecupererIle_ContainsSpecificIle()
{
// Arrange
var stubIle = new StubIle();
// Act
var iles = stubIle.RecupererIle();
// Assert
var ile = iles.FirstOrDefault(i => i.Nom == "Dawn");
Assert.NotNull(ile);
Assert.True("Don-to"== ile.NomRomanise);
Assert.True("East Blue" == ile.Region);
// ... assert other properties
}
}
}

@ -0,0 +1,40 @@
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class StubPersonnageTests
{
[Fact]
public void RecupererPersonnage_ReturnsPersonnageList()
{
// Arrange
var stubPersonnage = new StubPersonnage();
// Act
var personnages = stubPersonnage.RecupererPersonnage();
// Assert
Assert.NotNull(personnages);
}
[Fact]
public void RecupererPersonnage_ContainsSpecificPersonnage()
{
var stubPersonnage = new StubPersonnage();
var personnages = stubPersonnage.RecupererPersonnage();
var luffy = personnages.FirstOrDefault(p => p.Nom == "Luffy");
Assert.NotNull(luffy);
Assert.True(3000000000== luffy.Prime);
Assert.True("Luffy au Chapeau de Paille" == luffy.Epithete);
Assert.True(19 == luffy.Age);
Assert.True(1.74 == luffy.Taille);
}
}
}

@ -1,4 +1,6 @@
using Model;
using Model.Classes;
using Newtonsoft.Json.Bson;
using NuGet.Frameworks;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,5 +25,21 @@ namespace TestProject1
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurBateau2_ImageEgaleValeurParDefaut_ReturnTrue()
{
Bateau test = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void SurchargeEqualsBateau_Bateau1EgaleBateau2()
{
Bateau bateau1 = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", " ");
Bateau bateau2 = new Bateau("Sunny", "Sauzando Sani-go", 435, 321, "Le Thousand Sunny est...", "Ce bateau a pour particularités ...", " ");
bool resultat =(bateau1.Equals(bateau2));
Assert.True(resultat, "Les deux bateaux devraient etre égaux car ils onts le meme nom");
}
}
}

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -16,5 +16,26 @@ namespace TestProject1
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurBestiaire2_ImageEgaleValeurParDefaut_ReturnTrue()
{
Bestiaire test = new Bestiaire("Humains", "??", "Les humains sont ...", "Ils possèdent les caractéristiques suivantes ...","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void SurchargeEqualsBestiaire_Bestiaire1EgaleBestiaire2()
{
Bestiaire bestiaire1 = new Bestiaire("Humains", "??", "Les humains sont ...", "Ils possèdent les caractéristiques suivantes ...", "");
Bestiaire bestiaire2 = new Bestiaire("Humains", "??", "Les humains sont ...", "Ils possèdent les caractéristiques suivantes ...", "");
Personnage personnage1 = new Personnage("Perso", 0, "", 0, 0, "", "", "");
Bestiaire bestiaire3 = new Bestiaire("adad", "??", "Les humains sont ...", "Ils possèdent les caractéristiques suivantes ...", "");
bool resultat = (bestiaire1.Equals(bestiaire2));
bool resultat2 = (bestiaire1.Equals(personnage1));
bool resultat3 = (bestiaire1.Equals(bestiaire3));
Assert.True(resultat, "Les deux bestiaires devraient etre égaux car ils onts le meme nom");
Assert.False(resultat2);
Assert.False(resultat3);
}
}
}

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,5 +23,21 @@ namespace TestProject1
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurEquipage2_ImageEgaleValeurParDefaut_ReturnTrue()
{
Equipage test = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", -1, 0, true, "L'équipage du Roux ...","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void SurchargeEqualsEquipage_Equipage1EgaleEquipage2()
{
Equipage equiapge1= new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", -1, 0, true, "L'équipage du Roux ...", "");
Equipage equiapge2 = new Equipage("Équipage du Roux", "Akagami Kalzokudan", "East Blue", -1, 0, true, "L'équipage du Roux ...", "");
bool resultat = (equiapge1.Equals(equiapge2));
Assert.True(resultat, "Les deux equipages devraient etre égaux car ils onts le meme nom");
}
}
}

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -12,16 +12,33 @@ namespace TestProject1
[Fact]
public void FDD_PremierChapEtPremierEpSuperieurOuEgalAZero_ReturnTrue()
{
FruitDuDemon test = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", -5, -5, "Le Moku Moku no Mi, ou Fruit Fumigène en français, est un Fruit du Démon de type Logia qui transforme celui qui le mange en Homme-Fumée (煙人間, Kemuri Ningen). Il permet à son utilisateur de maîtriser, de produire à volonté et de se transformer en fumée. Ce fruit fut mangé par Smoker. Smoker est connu grâce à ce Fruit sous le surnom de \"Chasseur Blanc\".", "L'utilisateur de ce fruit a la capacité de générer, manipuler et devenir de la fumée. Comme la grande partie des utilisateurs de Logia, lorsque Smoker est touché, il peut tout simplement utiliser la capacité de son fruit pour se transformer en fumée, absorbant ainsi l'attaque et ne recevant alors aucun dégât. Comme certains Fruits du Démon de type Logia, il permet à Smoker de voler, en changeant la partie inférieure de son corps en fumée et en se propulsant, améliorant ainsi grandement sa mobilité et sa vitesse.\r\n\r\nLes principales qualités offensives du fruit proviennent de la capacité qu'il donne à son utilisateur de modifier la densité de la fumée qu'il produit à volonté. Ainsi, Smoker peut entourer sa cible de sa fumée intangible puis de la solidifier pour se saisir d'elle. Grâce à ce pouvoir, Smoker a reçu l'épithète: Le Chasseur Blanc. La fumée peut également être utilisée comme une arme pour frapper les ennemis avec puissance. Il est cependant possible d'échapper à l'emprise de la fumée avec un choc assez fort pour contrer cette force. ", "Il semblerait que lorsqu'il se retrouve confronté avec le feu (par exemple celui du pouvoir du Mera Mera no Mi), les deux pouvoirs s'annulent. A part cela, aucune faiblesse n'a encore été vue. Grâce à sa maîtrise instinctive de son pouvoir, le seul moyen sûr de le blesser est d'utiliser le Fluide, comme l'a fait Boa Hancock lors de leur courte altercation à Marineford ou d'utiliser les faiblesses habituelles des utilisateurs de Fruits du Démon, à savoir l'eau ou le Granit Marin.");
bool resultat = (test.PremierChap >= 0 && test.PremierEp >= 0);
FruitDuDemon test = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "", "", "");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "Les paramètre PremierChap et PremierEp doivent être supérieur ou égale à 0");
}
[Fact]
public void ConstructeurFDD_ImageEgaleValeurParDefaut_ReturnTrue()
{
FruitDuDemon test = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "Le Moku Moku no Mi, ou Fruit Fumigène en français, est un Fruit du Démon de type Logia qui transforme celui qui le mange en Homme-Fumée (煙人間, Kemuri Ningen). Il permet à son utilisateur de maîtriser, de produire à volonté et de se transformer en fumée. Ce fruit fut mangé par Smoker. Smoker est connu grâce à ce Fruit sous le surnom de \"Chasseur Blanc\".", "L'utilisateur de ce fruit a la capacité de générer, manipuler et devenir de la fumée. Comme la grande partie des utilisateurs de Logia, lorsque Smoker est touché, il peut tout simplement utiliser la capacité de son fruit pour se transformer en fumée, absorbant ainsi l'attaque et ne recevant alors aucun dégât. Comme certains Fruits du Démon de type Logia, il permet à Smoker de voler, en changeant la partie inférieure de son corps en fumée et en se propulsant, améliorant ainsi grandement sa mobilité et sa vitesse.\r\n\r\nLes principales qualités offensives du fruit proviennent de la capacité qu'il donne à son utilisateur de modifier la densité de la fumée qu'il produit à volonté. Ainsi, Smoker peut entourer sa cible de sa fumée intangible puis de la solidifier pour se saisir d'elle. Grâce à ce pouvoir, Smoker a reçu l'épithète: Le Chasseur Blanc. La fumée peut également être utilisée comme une arme pour frapper les ennemis avec puissance. Il est cependant possible d'échapper à l'emprise de la fumée avec un choc assez fort pour contrer cette force. ", "Il semblerait que lorsqu'il se retrouve confronté avec le feu (par exemple celui du pouvoir du Mera Mera no Mi), les deux pouvoirs s'annulent. A part cela, aucune faiblesse n'a encore été vue. Grâce à sa maîtrise instinctive de son pouvoir, le seul moyen sûr de le blesser est d'utiliser le Fluide, comme l'a fait Boa Hancock lors de leur courte altercation à Marineford ou d'utiliser les faiblesses habituelles des utilisateurs de Fruits du Démon, à savoir l'eau ou le Granit Marin.");
FruitDuDemon test = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "", "", "");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurFDD2_ImageEgaleValeurParDefaut_ReturnTrue()
{
FruitDuDemon test = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "", "", "","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void SurchargeEqualsFDD_FDD1EgaleFDD2()
{
FruitDuDemon fruit1 = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "", "", "", "");
FruitDuDemon fruit2 = new FruitDuDemon("Fruit de la fumée", "Moku Moku No Mi", "Logia", 97, 48, "", "", "", "");
bool resultat = (fruit1.Equals(fruit2));
Assert.True(resultat, "Les deux fruits du démon devraient etre égaux car ils onts le meme nom");
}
}
}

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -23,5 +23,20 @@ namespace TestProject1
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurIle2_ImageEgaleValeurParDefaut_ReturnTrue()
{
Ile test = new Ile("Dawn", "Don-to", "East Blue", 1, 4, "L'île de Dawn est ...", "Cette île est situé dans la mer d'East Blue près de ...","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void SurchargeEqualsIle_Ile1EgaleIle2()
{
Ile ile1 = new Ile("Dawn", "Don-to", "East Blue", 1, 4, "L'île de Dawn est ...", "Cette île est situé dans la mer d'East Blue près de ...", "");
Ile ile2 = new Ile("Dawn", "Don-to", "East Blue", 1, 4, "L'île de Dawn est ...", "Cette île est situé dans la mer d'East Blue près de ...", "");
bool resultat = (ile1.Equals(ile2));
Assert.True(resultat, "Les iles devraient etre égales car ils onts le meme nom");
}
}
}

@ -0,0 +1,350 @@
using Model.Classes;
using Model.Managers;
using Model.Serializer;
using Model.Stub;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class TestManager
{
public Manager manager = new Manager(new StubManager());
[Fact]
public void Constructor_InitializesCollections()
{
Assert.NotNull(manager.Bateaux);
Assert.NotNull(manager.Personnages);
Assert.NotNull(manager.Fruits);
Assert.NotNull(manager.Iles);
Assert.NotNull(manager.Bestiaire);
Assert.NotNull(manager.Equipages);
}
[Fact]
public void FiltrerFDD_ReturnsFilteredFruits()
{
// Arrange
var type = "Paramecia";
var fruits = new List<FruitDuDemon>
{
new FruitDuDemon("fruit1", "", "Paramecia", 0, 0,"","",""),
new FruitDuDemon("fruit2", "", "Logia", 0, 0,"","",""),
new FruitDuDemon("fruit3", "", "Zoan", 0, 0,"","",""),
};
manager.Fruits = new ObservableCollection<FruitDuDemon>(fruits);
// Act
var result = manager.FiltrerFDD(type);
// Assert
Assert.True(1== result.Count);
Assert.True("Paramecia"== result[0].Type);
}
[Fact]
public void FiltrerBateau_ReturnsMatchingBateaux()
{
var bateau1 = new Bateau("bateau1", "", 0, 0, "", "");
var bateau2 = new Bateau("bateau1", "", 0, 0, "", "");
var bateau3 = new Bateau("bateau", "", 0, 0, "", "");
bateau1.Affiliation = new Equipage("Mugiwara", "","",0,0,true,"");
bateau2.Affiliation = new Equipage("Barbe noire", "", "", 0, 0, true, "");
bateau3.Affiliation = new Equipage("Barbe blanche", "", "", 0, 0, true, "");
var bateaux = new List<Bateau> { bateau1,bateau2 ,bateau3};
manager.Bateaux = new ObservableCollection<Bateau>(bateaux);
var result = manager.FiltrerBateau("Mugiwara");
Assert.True(1 == result.Count);
Assert.True("Mugiwara" == result[0].Affiliation.Nom);
}
[Fact]
public void FiltrerIle_ReturnsMatchingIles()
{
var iles = new List<Ile> {
new Ile("ile1","","East Blue",0,0,"",""),
new Ile("ile2","","Grand Line",0,0,"",""),
new Ile("ile3","","West Blue",0,0,"",""),
};
manager.Iles = new ObservableCollection<Ile>(iles);
var result = manager.FiltrerIle("East Blue");
Assert.True(1 == result.Count);
Assert.True("East Blue" == result[0].Region);
}
[Fact]
public void RechercheObjetOhara_ReturnsFilteredList()
{
// Arrange
var text = "abc";
var obj1 = new ObjetOhara("abcd");
var obj2 = new ObjetOhara("bcde");
var obj3 = new ObjetOhara("defg");
var liste = new List<ObjetOhara> { obj1, obj2, obj3 };
// Act
var result = manager.RechercheObjetOhara(text, liste);
// Assert
Assert.True(1==result.Count);
Assert.Contains(obj1, result);
Assert.True(!result.Contains(obj3));
}
[Fact]
public void GetFavoris_ReturnsFavoritedObjects()
{
var obj1 =manager.Fruits.First();
var obj2 = manager.Equipages.First();
manager.ModifierFavFDD(obj1, true);
var result = manager.GetFavoris();
Assert.True(1==result.Count);
Assert.Contains(obj1, result);
Assert.True(!result.Contains(obj2));
}
[Fact]
public void ModifierFavFDD_UpdatesFruitDuDemonFavori()
{
var fruit = new FruitDuDemon("Fruit", "", "", 0, 0, "", "","");
manager.Fruits.Add(fruit);
manager.ModifierFavFDD(fruit, true);
fruit = manager.Fruits.FirstOrDefault(p => fruit.Nom == p.Nom);
Assert.NotNull(fruit);
Assert.True(fruit.EstFavori);
}
[Fact]
public void ModifierFavEquip_UpdatesEquipageFavori()
{
var equip = new Equipage("Equipage","","",0,0,true,"");
manager.Equipages.Add(equip);
manager.ModifierFavEquip(equip, true);
equip = manager.Equipages.FirstOrDefault(p=> equip.Nom == p.Nom);
Assert.NotNull(equip);
Assert.True(equip.EstFavori);
}
[Fact]
public void ModifierFavBest_UpdatesBestiaireFavori()
{
var best = new Bestiaire("Bestiaire", "", "","");
manager.Bestiaire.Add(best);
manager.ModifierFavBest(best, true);
best = manager.Bestiaire.FirstOrDefault(p => best.Nom == p.Nom);
Assert.NotNull(best);
Assert.True(best.EstFavori);
}
[Fact]
public void ModifierFavPerso_UpdatesPersonnageFavori()
{
var perso = new Personnage("Personnage", 0, "", 0, 0, "", "", "");
manager.Personnages.Add(perso);
manager.ModifierFavPerso(perso, true);
perso = manager.Personnages.FirstOrDefault(p => perso.Nom == p.Nom);
Assert.NotNull(perso);
Assert.True(perso.EstFavori);
}
[Fact]
public void ModifierFavIle_UpdatesIleFavori()
{
var ile = new Ile("Ile", "", "", 0, 0, "", "");
manager.Iles.Add(ile);
manager.ModifierFavIle(ile, true);
ile = manager.Iles.FirstOrDefault(p => ile.Nom == p.Nom);
Assert.NotNull(ile);
Assert.True(ile.EstFavori);
}
[Fact]
public void ModifierFavBateau_UpdatesBateauFavori()
{
var bateau = new Bateau("Bateau", "", 0, 0, "", "");
manager.Bateaux.Add(bateau);
manager.ModifierFavBateau(bateau, true);
bateau = manager.Bateaux.FirstOrDefault(p => bateau.Nom == p.Nom);
Assert.NotNull(bateau);
Assert.True(bateau.EstFavori);
}
[Fact]
public void ModifierIle_Should_UpdateIle_When_ExistingAncienNom()
{
Ile ancienneIle = new Ile("AncienNom","","",0,0,"","");
Ile nouvelleIle = new Ile("NouveauNom", "", "", 0, 0, "", "");
manager.Iles.Add(ancienneIle);
manager.ModifierIle(nouvelleIle, "AncienNom");
Assert.DoesNotContain(ancienneIle,manager.Iles);
Assert.Contains(nouvelleIle,manager.Iles); ;
}
[Fact]
public void ModifierIle_Should_NotUpdateIle_When_NonExistingAncienNom()
{
Ile ancienneIle = new Ile("AncienNom", "", "", 0, 0, "", "");
Ile nouvelleIle = new Ile("NouveauNom", "", "", 0, 0, "", "");
manager.Iles.Add(ancienneIle);
manager.ModifierIle(nouvelleIle, "iadjadiozadioazj");
Assert.Contains(ancienneIle, manager.Iles);
Assert.DoesNotContain(nouvelleIle, manager.Iles);
}
[Fact]
public void ModifierFDD_Should_UpdateIle_When_ExistingAncienNom()
{
FruitDuDemon ancienneFDD = new FruitDuDemon("AncienNom", "", "",0, 0, "", "","");
FruitDuDemon nouvelleFDD = new FruitDuDemon("NouveauNom", "", "", 0, 0, "", "","");
manager.Fruits.Add(ancienneFDD);
manager.ModifierFDD(nouvelleFDD, "AncienNom");
Assert.DoesNotContain(ancienneFDD, manager.Fruits);
Assert.Contains(nouvelleFDD, manager.Fruits); ;
}
[Fact]
public void ModifierFDD_Should_NotUpdateIle_When_NonExistingAncienNom()
{
FruitDuDemon ancienneFDD = new FruitDuDemon("AncienNom", "", "", 0, 0, "", "", "");
FruitDuDemon nouvelleFDD = new FruitDuDemon("NouveauNom", "", "", 0, 0, "", "", "");
manager.Fruits.Add(ancienneFDD);
manager.ModifierFDD(nouvelleFDD, "ADADADAZDAZD");
Assert.Contains(ancienneFDD, manager.Fruits);
Assert.DoesNotContain(nouvelleFDD, manager.Fruits);
}
[Fact]
public void ModifierPerso_Should_UpdateIle_When_ExistingAncienNom()
{
Personnage ancienPerso = new Personnage("AncienNom",0,"",0,0, "", "", "");
Personnage nouveauPerso = new Personnage("NouveauNom", 0, "", 0,0, "", "", "");
manager.Personnages.Add(ancienPerso);
manager.ModifierPerso(nouveauPerso, "AncienNom");
Assert.DoesNotContain(ancienPerso, manager.Personnages);
Assert.Contains(nouveauPerso, manager.Personnages);
}
[Fact]
public void ModifierPerso_Should_NotUpdateIle_When_NonExistingAncienNom()
{
Personnage ancienPerso = new Personnage("AncienNom", 0, "", 0, 0, "", "", "");
Personnage nouveauPerso = new Personnage("NouveauNom", 0, "", 0, 0, "", "", "");
manager.Personnages.Add(ancienPerso);
manager.ModifierPerso(nouveauPerso, "adadadadzdd");
Assert.Contains(ancienPerso, manager.Personnages);
Assert.DoesNotContain(nouveauPerso, manager.Personnages);
}
[Fact]
public void ModifierBest_Should_UpdateIle_When_ExistingAncienNom()
{
Bestiaire ancienBest = new Bestiaire("AncienNom", "", "", "", "");
Bestiaire nouveauBest = new Bestiaire("NouveauNom", "", "", "", "");
manager.Bestiaire.Add(ancienBest);
manager.ModifierBest(nouveauBest, "AncienNom");
Assert.DoesNotContain(ancienBest, manager.Bestiaire);
Assert.Contains(nouveauBest, manager.Bestiaire);
}
[Fact]
public void ModifierBest_Should_NotUpdateIle_When_NonExistingAncienNom()
{
Bestiaire ancienBest = new Bestiaire("AncienNom", "", "", "", "");
Bestiaire nouveauBest = new Bestiaire("NouveauNom", "", "", "", "");
manager.Bestiaire.Add(ancienBest);
manager.ModifierBest(nouveauBest, "adadadadzdd");
Assert.Contains(ancienBest, manager.Bestiaire);
Assert.DoesNotContain(nouveauBest, manager.Bestiaire);
}
[Fact]
public void ModifierEquip_Should_UpdateIle_When_ExistingAncienNom()
{
Equipage ancienEquîp = new Equipage("AncienNom", "", "",0,0 ,true, "");
Equipage nouveauEquip = new Equipage("NouveauNom", "", "", 0, 0, true, "");
manager.Equipages.Add(ancienEquîp);
manager.ModifierEquipage(nouveauEquip, "AncienNom");
Assert.DoesNotContain(ancienEquîp, manager.Equipages);
Assert.Contains(nouveauEquip, manager.Equipages);
}
[Fact]
public void ModifierEquipage_Should_NotUpdateIle_When_NonExistingAncienNom()
{
Equipage ancienEquîp = new Equipage("AncienNom", "", "", 0, 0, true, "");
Equipage nouveauEquip = new Equipage("NouveauNom", "", "", 0, 0, true, "");
manager.Equipages.Add(ancienEquîp);
manager.ModifierEquipage(nouveauEquip, "adadadda");
Assert.Contains(ancienEquîp, manager.Equipages);
Assert.DoesNotContain(nouveauEquip, manager.Equipages);
}
[Fact]
public void ModifierBateau_Should_UpdateIle_When_ExistingAncienNom()
{
Bateau ancienBateau = new Bateau("AncienNom", "", 0, 0, "", "");
Bateau nouveauBateau = new Bateau("NouveauNom", "", 0, 0, "", "");
manager.Bateaux.Add(ancienBateau);
manager.ModifierBateau(nouveauBateau, "AncienNom");
Assert.DoesNotContain(ancienBateau, manager.Bateaux);
Assert.Contains(nouveauBateau, manager.Bateaux);
}
[Fact]
public void ModifierBateau_Should_NotUpdateIle_When_NonExistingAncienNom()
{
Bateau ancienBateau = new Bateau("AncienNom", "", 0, 0, "", "");
Bateau nouveauBateau = new Bateau("NouveauNom", "", 0, 0, "", "");
manager.Bateaux.Add(ancienBateau);
manager.ModifierBateau(nouveauBateau, "adfadadzdaz");
Assert.Contains(ancienBateau, manager.Bateaux);
Assert.DoesNotContain(nouveauBateau, manager.Bateaux);
}
}
}

@ -0,0 +1,48 @@
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class TestObjetOhara
{
[Fact]
public void ToString_ReturnsCorrectStringRepresentation()
{
var obj = new ObjetOhara("Objet 1", "image.png", true);
var result = obj.ToString();
Assert.True("ObjetOhara : Objet 1 True image.png"== result);
}
[Fact]
public void Equals_SameObject_ReturnsTrue()
{
var obj = new ObjetOhara("Objet 1");
var obj2 = new ObjetOhara("Objet 2");
var obj3 = new Bateau("Objet 3", "", 0, 0, "","");
var result = obj.Equals(obj);
var result2 = obj.Equals(obj2);
var result3 = obj.Equals(obj3);
Assert.True(result);
Assert.False(result2);
Assert.False(result3);
}
[Fact]
public void GetHashCode_ObjectsWithSameProperties_ReturnsSameHashCode()
{
var obj1 = new ObjetOhara("Objet 1", "image.png", true);
var obj2 = new ObjetOhara("Objet 1", "image.png", true);
var hashCode1 = obj1.GetHashCode();
var hashCode2 = obj2.GetHashCode();
Assert.True(hashCode1==hashCode2);
}
}
}

@ -1,4 +1,4 @@
using Model;
using Model.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
@ -16,6 +16,14 @@ namespace TestProject1
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void ConstructeurPersonnage2_ImageEgaleValeurParDefaut_ReturnTrue()
{
Personnage test = new Personnage("Luffy", 3000000000, "Luffy au Chapeau de Paille", 19, 1.74, "East Blue", "Monkey D. Luffy est...", "Le Roi des Pirates, ce sera moi !","");
bool resultat = (test.Image == "baseimage.png");
Assert.True(resultat, "L'image devrait avoir la valeur : baseimage.png");
}
[Fact]
public void Personnage_PrimeSuperieurOuEgalAZero_ReturnTrue()
{
@ -30,5 +38,13 @@ namespace TestProject1
bool resultat = (test.Taille >= 0);
Assert.True(resultat, "La taille du personnage doit avoir une valeur positive");
}
[Fact]
public void SurchargeEqualsPersonnage_Personnage1EgalePersonnage2()
{
Personnage personnage1 = new Personnage("Luffy", 3000000000, "Luffy au Chapeau de Paille", 19, -1, "East Blue", "Monkey D. Luffy est...", "Le Roi des Pirates, ce sera moi !", "luffy.png");
Personnage personnage2 = new Personnage("Luffy", 3000000000, "Luffy au Chapeau de Paille", 19, -1, "East Blue", "Monkey D. Luffy est...", "Le Roi des Pirates, ce sera moi !", "luffy.png");
bool resultat = (personnage1.Equals(personnage1));
Assert.True(resultat, "Les personanges devraient etre égales car ils onts le meme nom");
}
}
}

@ -0,0 +1,348 @@
using Model.Classes;
using Model.Serializer;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
namespace TestProject1
{
public class XMLSerializerTests
{
public XML_Serializer serializer = new XML_Serializer();
[Fact]
public void SetPersonnage_SerializesAndWritesToFile()
{
var obj1 = new Personnage("Personnage 1", 0, "", 0, 0, "", "", "");
var obj2 = new Personnage("Personnage 2", 0, "", 0, 0, "", "", "");
var listePerso = new List<Personnage>
{
obj1,
obj2,
};
serializer.SetPersonnage(listePerso);
string xmlFilePath = Path.Combine(serializer.Chemin, "personnage.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<Personnage>));
var result = deserializer.ReadObject(stream) as List<Personnage>;
Assert.NotNull(result);
Assert.Contains(obj1,result);
Assert.Contains(obj2,result);
}
}
[Fact]
public void GetPersonnages_ReadsFromFileAndDeserializes()
{
var obj1 = new Personnage("Personnage 1", 0, "", 0, 0, "", "", "");
var obj2 = new Personnage("Personnage 2", 0, "", 0, 0, "", "", "");
var listePerso = new List<Personnage>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "personnage.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<Personnage>));
xmlSerializer.WriteObject(stream, listePerso);
}
var result = serializer.GetPersonnages();
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
[Fact]
public void SetEquipages_SerializesAndWritesToFile()
{
var obj1 = new Equipage("Equipage 1", "","", 0, 0,true, "");
var obj2 = new Equipage("Equipage 2", "", "", 0, 0, true, "");
var listeEquip = new List<Equipage>
{
obj1,
obj2,
};
serializer.SetEquipage(listeEquip);
string xmlFilePath = Path.Combine(serializer.Chemin, "equipage.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<Equipage>));
var result = deserializer.ReadObject(stream) as List<Equipage>;
Assert.NotNull(result);
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
[Fact]
public void GetEquipages_ReadsFromFileAndDeserializes()
{
var obj1 = new Equipage("Equipage 1", "", "", 0, 0, true, "");
var obj2 = new Equipage("Equipage 2", "", "", 0, 0, true, "");
var listeEquip = new List<Equipage>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "equipage.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<Equipage>));
xmlSerializer.WriteObject(stream, listeEquip);
}
// Act
var result = serializer.GetEquipages();
// Assert
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
[Fact]
public void SetFDD_SerializesAndWritesToFile()
{
/// Arrange
var obj1 = new FruitDuDemon("Fruit 1", "","", 0, 0, "", "", "");
var obj2 = new FruitDuDemon("Fruit 2", "", "", 0, 0, "", "", "");
var listFDD = new List<FruitDuDemon>
{
obj1,
obj2,
};
// Act
serializer.SetFDD(listFDD);
// Assert
string xmlFilePath = Path.Combine(serializer.Chemin, "fruitdudemon.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
var result = deserializer.ReadObject(stream) as List<FruitDuDemon>;
Assert.NotNull(result);
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
[Fact]
public void GetFDD_ReadsFromFileAndDeserializes()
{
var obj1 = new FruitDuDemon("Fruit 1", "", "", 0, 0, "", "", "");
var obj2 = new FruitDuDemon("Fruit 2", "", "", 0, 0, "", "", "");
var listFDD = new List<FruitDuDemon>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "fruitdudemon.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<FruitDuDemon>));
xmlSerializer.WriteObject(stream, listFDD);
}
// Act
var result = serializer.GetFruits();
// Assert
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
[Fact]
public void SetBestiaire_SerializesAndWritesToFile()
{
/// Arrange
var obj1 = new Bestiaire("Bestiaire 1", "", "", "");
var obj2 = new Bestiaire("Bestiaire 2", "", "", "");
var listBest = new List<Bestiaire>
{
obj1,
obj2,
};
// Act
serializer.SetBestiaire(listBest);
// Assert
string xmlFilePath = Path.Combine(serializer.Chemin, "bestiaire.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<Bestiaire>));
var result = deserializer.ReadObject(stream) as List<Bestiaire>;
Assert.NotNull(result);
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
[Fact]
public void GetBestiaire_ReadsFromFileAndDeserializes()
{
// Arrange
var obj1 = new Bestiaire("Bestiaire 1", "", "", "");
var obj2 = new Bestiaire("Bestiaire 2", "", "", "");
var listBest = new List<Bestiaire>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "bestiaire.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<Bestiaire>));
xmlSerializer.WriteObject(stream, listBest);
}
// Act
var result = serializer.GetBestiaires();
// Assert
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
[Fact]
public void SetBateau_SerializesAndWritesToFile()
{
var obj1 = new Bateau("Bateau 1", "", 0, 0, "", "", "");
var obj2 = new Bateau("Bateau 2", "", 0, 0, "", "", "");
var listeBateau = new List<Bateau>
{
obj1,
obj2,
};
serializer.SetBateau(listeBateau);
string xmlFilePath = Path.Combine(serializer.Chemin, "bateau.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<Bateau>));
var result = deserializer.ReadObject(stream) as List<Bateau>;
Assert.NotNull(result);
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
[Fact]
public void GetBateau_ReadsFromFileAndDeserializes()
{
var obj1 = new Bateau("Bateau 1", "", 0, 0, "", "", "");
var obj2 = new Bateau("Bateau 2", "", 0, 0, "", "", "");
var listeBateau = new List<Bateau>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "bateau.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<Bateau>));
xmlSerializer.WriteObject(stream, listeBateau);
}
var result = serializer.GetBateaux();
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
[Fact]
public void SetIle_SerializesAndWritesToFile()
{
var obj1 = new Ile("Ile 1", "","", 0, 0, "", "");
var obj2 = new Ile("Ile 2", "", "",0, 0, "", "");
var listeIle = new List<Ile>
{
obj1,
obj2,
};
serializer.SetIle(listeIle);
string xmlFilePath = Path.Combine(serializer.Chemin, "ile.xml");
Assert.True(File.Exists(xmlFilePath));
using (Stream stream = File.OpenRead(xmlFilePath))
{
var deserializer = new DataContractSerializer(typeof(List<Ile>));
var result = deserializer.ReadObject(stream) as List<Ile>;
Assert.NotNull(result);
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
[Fact]
public void GetIle_ReadsFromFileAndDeserializes()
{
var obj1 = new Ile("Ile 1", "", "", 0, 0, "", "");
var obj2 = new Ile("Ile 2", "", "", 0, 0, "", "");
var listeIle = new List<Ile>
{
obj1,
obj2,
};
string xmlFilePath = Path.Combine(serializer.Chemin, "ile.xml");
using (Stream stream = File.Create(xmlFilePath))
{
var xmlSerializer = new DataContractSerializer(typeof(List<Ile>));
xmlSerializer.WriteObject(stream, listeIle);
}
var result = serializer.GetIles();
Assert.NotNull(result);
var resultList = result.ToList();
Assert.Contains(obj1, result);
Assert.Contains(obj2, result);
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Loading…
Cancel
Save