merge
continuous-integration/drone/push Build was killed
Details
@ -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>
|
||||
|
||||

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

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

|
||||
|
||||
|
||||
|
||||
# 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...
|
||||
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
@ -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;
|
||||
}
|
||||
}
|
@ -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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -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,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
|
||||
}
|
@ -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
|
||||
}
|
@ -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
|
||||
}
|
@ -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
|
||||
}
|
||||
|
||||
}
|
After Width: | Height: | Size: 788 KiB |
After Width: | Height: | Size: 8.4 KiB |
After Width: | Height: | Size: 224 KiB |
After Width: | Height: | Size: 48 KiB |
After Width: | Height: | Size: 102 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 35 KiB |