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
{
public class Bateau
public class Bateau : ObjetOhara
{
public string Nom { get; set; }
public string NomRomanise { get; set; }
public Equipage? Affiliation { get; set; }
public int PremierChap { get; set; }
public int PremierEp { get; set; }
public string Description { 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;
PremierChap = premierChap;
PremierEp = premierEp;
Description = description;
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)

@ -7,25 +7,21 @@ using System.Threading.Tasks;
namespace Model
{
public class Bestiaire
public class Bestiaire : ObjetOhara
{
public string Nom { get; set; }
public string Origine { get; set; }
public string Description { 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;
Description = description;
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
{
public class Equipage
public class Equipage : ObjetOhara
{
public string Nom { get; set; }
public string NomRomanise { get; set; }
public string Region { get; set; }
public int PremierChap { get; set; }
public int PremierEp { get; set; }
@ -19,18 +18,18 @@ namespace Model
public Personnage? Capitaine { get; set; }
public List<Personnage> Membre { get; set; } = new List<Personnage>();
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;
Region = region;
PremierChap = premierChap;
PremierEp = premierEp;
Statut = statut;
Description = description;
Image = image;
}
}
}

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

@ -6,28 +6,28 @@ using System.Threading.Tasks;
namespace Model
{
public class Ile
public class Ile : ObjetOhara
{
public string Nom { get; set; }
public string NomRomanise { get; set; }
public string Region { get; set; }
public int PremierChap { get; set; }
public int PremierEp { get; set; }
public string Description { 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;
Region = region;
PremierChap = premierChap;
PremierEp = premierEp;
Description = description;
Geographie = geographie;
Image = image;
}
}
}

@ -42,5 +42,18 @@ namespace Model
{
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
{
public class Personnage
public class Personnage : ObjetOhara
{
public string Nom { get; set; }
public double Prime { get; set; }
public string Epithete { get; set; }
public int Age { get; set; }
@ -12,13 +12,13 @@
public string Citation { get; set; }
public Equipage? Equipage { get; set; }
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;
Epithete = epithete;
Age = age;
@ -26,7 +26,7 @@
Origine = origine;
Biographie = biographie;
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)

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

@ -50,7 +50,7 @@
</Frame>
</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>
<DataTemplate>
<Grid Padding="20" ColumnSpacing="20" RowSpacing="20">

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

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

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

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

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

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

Loading…
Cancel
Save