diff --git a/Sources/Modèle/Monstre.cs b/Sources/Modèle/Monstre.cs index 54fb46f..fec68a1 100644 --- a/Sources/Modèle/Monstre.cs +++ b/Sources/Modèle/Monstre.cs @@ -73,8 +73,14 @@ namespace Model public List ListConseils { get; set; } public string ImageLink { get; init ; } + public string CardLink { get; init; } public Monstre(int id, string name, string danger, string desc, List characList, List appearList, List conseilList) { + if (string.IsNullOrWhiteSpace(name) || string.IsNullOrWhiteSpace(desc) || string.IsNullOrWhiteSpace(danger)) + { + throw new ArgumentException("Un monstre doit avoir un nom, une description et une dangerosité!"); + } + Id = id; Name = name; Dangerosite = danger; @@ -83,11 +89,7 @@ namespace Model AppearanceList = appearList; ListConseils = conseilList; ImageLink = name.ToLower() + ".png"; - - if (string.IsNullOrWhiteSpace(Name) || string.IsNullOrWhiteSpace(Description) || string.IsNullOrWhiteSpace(danger)) - { - throw new ArgumentException("Un monstre doit avoir un nom, une description et une dangerosité!"); - } + CardLink = "collection" + name.ToLower() + ".png"; } public override string ToString() @@ -105,6 +107,6 @@ namespace Model } public override int GetHashCode() - => base.GetHashCode(); + => Name.GetHashCode(); } } \ No newline at end of file diff --git a/Sources/Modèle/User.cs b/Sources/Modèle/User.cs index 5865c85..5e27bf1 100644 --- a/Sources/Modèle/User.cs +++ b/Sources/Modèle/User.cs @@ -13,7 +13,7 @@ namespace Model { /// /// La classe User représente un utilisateur ayant pour identifiant son pseudo (publique), - /// son nom et prénom en privé, pour une utilisation ultérieure et/ou pour identifier de manière + /// son nom et prénom, pour une utilisation ultérieure et/ou pour identifier de manière /// plus simple l'utilisateur dans la base de donnée (car un pseudo n'est pas forcément explicite) /// [DataContract] diff --git a/Sources/Vues/App.xaml.cs b/Sources/Vues/App.xaml.cs index a514307..45b41e8 100644 --- a/Sources/Vues/App.xaml.cs +++ b/Sources/Vues/App.xaml.cs @@ -7,6 +7,23 @@ namespace Vues public partial class App : Application { public MonsterManager monsterManager { get; private set; } = new MonsterManager(new LoaderStub()); + public UserManager userManager { get; private set; } = new UserManager(new LoaderXml()); + + private User user; + public User User + { + get + { + return user; + } + set + { + user = value; + OnPropertyChanged("User"); + } + } + + private Monstre monstreSelectionne; public Monstre MonstreSelectionne { get { @@ -18,7 +35,6 @@ namespace Vues OnPropertyChanged("MonstreSelectionne"); } } - private Monstre monstreSelectionne; public App() { InitializeComponent(); diff --git a/Sources/Vues/Connexion.xaml b/Sources/Vues/Connexion.xaml index 4a60b9b..882eb1e 100644 --- a/Sources/Vues/Connexion.xaml +++ b/Sources/Vues/Connexion.xaml @@ -19,9 +19,10 @@