Héritages ObjetOhara + début de la fonctionnalité filtrer dans Fruit du démon

devGuillaume
Yoan 2 years ago
parent b09a4b0f64
commit 9167e3be63

@ -6,27 +6,27 @@ using System.Threading.Tasks;
namespace Model namespace Model
{ {
public class Bateau public class Bateau : ObjetOhara
{ {
public string Nom { get; set; }
public string NomRomanise { get; set; } public string NomRomanise { get; set; }
public Equipage? Affiliation { get; set; } public Equipage? Affiliation { get; set; }
public int PremierChap { get; set; } public int PremierChap { get; set; }
public int PremierEp { get; set; } public int PremierEp { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string Caracteristique { get; set; } public string Caracteristique { get; set; }
public string? Image { get; set; }
public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image) public Bateau(string nom, string nomRomanise, int premierChap, int premierEp, string description, string caracteristique, string image) : base(nom,image)
{ {
Nom = nom;
NomRomanise = nomRomanise; NomRomanise = nomRomanise;
PremierChap = premierChap; PremierChap = premierChap;
PremierEp = premierEp; PremierEp = premierEp;
Description = description; Description = description;
Caracteristique = caracteristique; Caracteristique = caracteristique;
Image= image;
} }
public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique,image) public Bateau(string nom, string nomRomanise, Equipage affiliation, int premierChap, int premierEp, string description, string caracteristique, string image) : this(nom,nomRomanise,premierChap,premierEp,description,caracteristique,image)

@ -7,25 +7,21 @@ using System.Threading.Tasks;
namespace Model namespace Model
{ {
public class Bestiaire public class Bestiaire : ObjetOhara
{ {
public string Nom { get; set; }
public string Origine { get; set; } public string Origine { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string Caracteristique { get; set; } public string Caracteristique { get; set; }
public string? Image { get; set; }
public Bestiaire(string nom, string origine, string description, string caracteristique) public Bestiaire(string nom, string origine, string description, string caracteristique,string image) : base(nom, image)
{ {
Nom = nom;
Origine = origine; Origine = origine;
Description = description; Description = description;
Caracteristique = caracteristique; Caracteristique = caracteristique;
} }
public Bestiaire(string nom, string origine, string description, string caracteristique,string image) : this(nom,origine,description,caracteristique)
{
Image = image;
}
} }
} }

@ -6,11 +6,10 @@ using System.Threading.Tasks;
namespace Model namespace Model
{ {
public class Equipage public class Equipage : ObjetOhara
{ {
public string Nom { get; set; }
public string NomRomanise { get; set; } public string NomRomanise { get; set; }
public string Region { get; set; } public string Region { get; set; }
public int PremierChap { get; set; } public int PremierChap { get; set; }
public int PremierEp { get; set; } public int PremierEp { get; set; }
@ -19,18 +18,18 @@ namespace Model
public Personnage? Capitaine { get; set; } public Personnage? Capitaine { get; set; }
public List<Personnage> Membre { get; set; } = new List<Personnage>(); public List<Personnage> Membre { get; set; } = new List<Personnage>();
public List<Equipage> Allie { get; set; } = new List<Equipage>(); public List<Equipage> Allie { get; set; } = new List<Equipage>();
public string? Image { get; set; }
public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description,string image) public Equipage(string nom, string nomRomanise, string region, int premierChap, int premierEp, bool statut, string description,string image) : base(nom,image)
{ {
Nom = nom;
NomRomanise = nomRomanise; NomRomanise = nomRomanise;
Region = region; Region = region;
PremierChap = premierChap; PremierChap = premierChap;
PremierEp = premierEp; PremierEp = premierEp;
Statut = statut; Statut = statut;
Description = description; Description = description;
Image = image;
} }
} }
} }

@ -6,9 +6,9 @@ using System.Threading.Tasks;
namespace Model namespace Model
{ {
public class FruitDuDemon public class FruitDuDemon : ObjetOhara
{ {
public string Nom { get; set; }
public string NomRomanise { get; set; } public string NomRomanise { get; set; }
public string Type { get; set; } public string Type { get; set; }
public int PremierChap { get; set; } public int PremierChap { get; set; }
@ -17,11 +17,12 @@ namespace Model
public string Forces { get; set; } public string Forces { get; set; }
public string Faiblesses { get; set; } public string Faiblesses { get; set; }
public List<Personnage> Utilisateur { get; set; }= new List<Personnage>(); public List<Personnage> Utilisateur { get; set; }= new List<Personnage>();
public string? Image { get; set; }
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses) public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, string image) : base(nom,image)
{ {
Nom = nom;
NomRomanise = nomRomanise; NomRomanise = nomRomanise;
Type = type; Type = type;
PremierChap = premierChap; PremierChap = premierChap;
@ -29,13 +30,9 @@ namespace Model
Description = description; Description = description;
Forces = forces; Forces = forces;
Faiblesses = faiblesses; Faiblesses = faiblesses;
}
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image) : this(nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
{
Image = image;
} }
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses)
public FruitDuDemon(string nom, string nomRomanise, string type, int premierChap, int premierEp, string description, string forces, string faiblesses,string image, List<Personnage> utilisateur) : this( nom, nomRomanise, type, premierChap, premierEp, description, forces, faiblesses, image)
{ {
Utilisateur = utilisateur; Utilisateur = utilisateur;
} }

@ -6,28 +6,28 @@ using System.Threading.Tasks;
namespace Model namespace Model
{ {
public class Ile public class Ile : ObjetOhara
{ {
public string Nom { get; set; }
public string NomRomanise { get; set; } public string NomRomanise { get; set; }
public string Region { get; set; } public string Region { get; set; }
public int PremierChap { get; set; } public int PremierChap { get; set; }
public int PremierEp { get; set; } public int PremierEp { get; set; }
public string Description { get; set; } public string Description { get; set; }
public string Geographie { get; set; } public string Geographie { get; set; }
public string? Image { get; set; }
public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) public Ile(string nom, string nomRomanise, string region, int premierChap, int premierEp, string description, string geographie, string image) : base(nom,image)
{ {
Nom = nom;
NomRomanise = nomRomanise; NomRomanise = nomRomanise;
Region = region; Region = region;
PremierChap = premierChap; PremierChap = premierChap;
PremierEp = premierEp; PremierEp = premierEp;
Description = description; Description = description;
Geographie = geographie; Geographie = geographie;
Image = image;
} }
} }
} }

@ -42,5 +42,18 @@ namespace Model
{ {
return DataManager.GetIles().ToList(); return DataManager.GetIles().ToList();
} }
public List<FruitDuDemon> FiltrerFDD(string type)
{
List<FruitDuDemon> fdd = GetFruits();
foreach(FruitDuDemon f in fdd.ToList())
{
if(f.Type != type)
{
fdd.Remove(f);
}
}
return fdd;
}
} }
} }

@ -1,8 +1,8 @@
namespace Model namespace Model
{ {
public class Personnage public class Personnage : ObjetOhara
{ {
public string Nom { get; set; }
public double Prime { get; set; } public double Prime { get; set; }
public string Epithete { get; set; } public string Epithete { get; set; }
public int Age { get; set; } public int Age { get; set; }
@ -12,13 +12,13 @@
public string Citation { get; set; } public string Citation { get; set; }
public Equipage? Equipage { get; set; } public Equipage? Equipage { get; set; }
public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>(); public List<FruitDuDemon> Fruit { get; set; } = new List<FruitDuDemon>();
public string? Image { get; set; }
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image) public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation, string image) : base(nom,image)
{ {
Nom = nom;
Prime = prime; Prime = prime;
Epithete = epithete; Epithete = epithete;
Age = age; Age = age;
@ -26,7 +26,7 @@
Origine = origine; Origine = origine;
Biographie = biographie; Biographie = biographie;
Citation = citation; Citation = citation;
Image = image;
} }
public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image) public Personnage(string nom, double prime, string epithete, int age, double taille, string origine, string biographie, string citation,string image ,Equipage equipage,List<FruitDuDemon> fruit) : this(nom,prime,epithete,age,taille,origine,biographie,citation,image)

@ -54,7 +54,7 @@
</Grid> </Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always"> <ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeBateau" ItemsLayout="HorizontalList"> <CollectionView x:Name="listeBateau" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>

@ -50,7 +50,7 @@
</Frame> </Frame>
</Grid> </Grid>
<CollectionView x:Name="listeBest" ItemsUpdatingScrollMode="KeepScrollOffset" VerticalScrollBarVisibility="Always" ItemsLayout="VerticalGrid, 4"> <CollectionView x:Name="listeBest" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20"> <Grid Padding="20" ColumnSpacing="20" RowSpacing="20">

@ -52,7 +52,7 @@
</Frame> </Frame>
</Grid> </Grid>
<CollectionView x:Name="listeEquip" ItemsLayout="VerticalGrid, 4"> <CollectionView x:Name="listeEquip" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20"> <Grid Padding="20" ColumnSpacing="20" RowSpacing="20">

@ -1,54 +1,54 @@
namespace Ohara; namespace Ohara;
using Model; using Model;
using Model.Stub; using Model.Stub;
public partial class PageEquipage : ContentPage public partial class PageEquipage : ContentPage
{ {
public PageEquipage() public PageEquipage()
{ {
InitializeComponent(); InitializeComponent();
var manager = new Manager(); var manager = new Manager();
listeEquip.ItemsSource = manager.GetEquipages(); listeEquip.ItemsSource = manager.GetEquipages();
} }
private async void Hyperlink_Accueil(object sender, EventArgs e) private async void Hyperlink_Accueil(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new MainPage()); await Navigation.PushAsync(new MainPage());
} }
private async void Hyperlink_FDD(object sender, EventArgs e) private async void Hyperlink_FDD(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageFDD()); await Navigation.PushAsync(new PageFDD());
} }
private async void Hyperlink_Equip(object sender, EventArgs e) private async void Hyperlink_Equip(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageEquipage()); await Navigation.PushAsync(new PageEquipage());
} }
private async void Hyperlink_Perso(object sender, EventArgs e) private async void Hyperlink_Perso(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PagePersonnage()); await Navigation.PushAsync(new PagePersonnage());
} }
private async void Hyperlink_Bateau(object sender, EventArgs e) private async void Hyperlink_Bateau(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageBateau()); await Navigation.PushAsync(new PageBateau());
} }
private async void Hyperlink_Bestiaire(object sender, EventArgs e) private async void Hyperlink_Bestiaire(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageBestiaire()); await Navigation.PushAsync(new PageBestiaire());
} }
private async void Hyperlink_Carte(object sender, EventArgs e) private async void Hyperlink_Carte(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageCarte()); await Navigation.PushAsync(new PageCarte());
} }
private async void Hyperlink_Ile(object sender, EventArgs e) private async void Hyperlink_Ile(object sender, EventArgs e)
{ {
await Navigation.PushAsync(new PageIle()); await Navigation.PushAsync(new PageIle());
} }
private void listeEquip_ScrollToRequested(object sender, ScrollToRequestEventArgs e) private void listeEquip_ScrollToRequested(object sender, ScrollToRequestEventArgs e)
{ {
} }
} }

@ -4,7 +4,7 @@
x:Class="Ohara.PageFDD" x:Class="Ohara.PageFDD"
Title="PageFDD" Title="PageFDD"
BackgroundColor="#e2edf1"> BackgroundColor="#e2edf1">
<Grid> <Grid>
@ -46,16 +46,16 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0" x:Name="searchBar" /> <SearchBar Placeholder="Rechercher..." BackgroundColor="#bfe5ef" Grid.Column="0" x:Name="searchBar" />
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2"> <Button Text="Filtrer" x:Name="Logia" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="2"/>
<Label Text="Filtrer" HorizontalTextAlignment="Center" />
</Frame>
<Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3"> <Frame CornerRadius="20" BackgroundColor="#bfe5ef" BorderColor="#bfe5ef" Grid.Column="3">
<Label Text="Trier" HorizontalTextAlignment="Center" /> <Label Text="Trier" HorizontalTextAlignment="Center" />
</Frame> </Frame>
</Grid> </Grid>
<CollectionView x:Name="listeFDD" ItemsLayout="VerticalGrid, 4"> <CollectionView x:Name="listeFDD" ItemsLayout="VerticalGrid, 4" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>
<Grid Padding="20" > <Grid Padding="20" >

@ -1,18 +1,25 @@
namespace Ohara; namespace Ohara;
using Model; using Model;
using Model.Stub; using Model.Stub;
using System.Windows.Input;
public partial class PageFDD : ContentPage public partial class PageFDD : ContentPage
{ {
public ICommand FiltrerType { get; private set; }
public PageFDD() public PageFDD()
{ {
InitializeComponent(); InitializeComponent();
var manager = new Manager();
var manager = new Manager();
listeFDD.ItemsSource = manager.GetFruits(); listeFDD.ItemsSource = manager.GetFruits();
FiltrerType = new Command(() => listeFDD.ItemsSource = manager.FiltrerFDD("Logia"));
Logia.Command = FiltrerType;
} }
private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e) private void listeFDD_ScrollToRequested(object sender, ScrollToRequestEventArgs e)

@ -54,7 +54,7 @@
</Grid> </Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always"> <ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listeIle" ItemsLayout="HorizontalList"> <CollectionView x:Name="listeIle" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>

@ -57,7 +57,7 @@
</Grid> </Grid>
<ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always"> <ScrollView Orientation="Horizontal" HorizontalScrollBarVisibility="Always">
<CollectionView x:Name="listePerso" ItemsLayout="HorizontalList"> <CollectionView x:Name="listePerso" ItemsLayout="HorizontalList" EmptyView="Aucun résultat trouvé.">
<CollectionView.ItemTemplate> <CollectionView.ItemTemplate>
<DataTemplate> <DataTemplate>

Loading…
Cancel
Save