From 12172efa8383a9cdb4292473b91cf963bc8bf753 Mon Sep 17 00:00:00 2001 From: ImNicolasTheDev Date: Sun, 7 May 2023 20:43:37 +0200 Subject: [PATCH] Deleted Conseil.cs + updated Monstre attributes to automatic property, removed backing field of them + removed not needed member initializer --- Sources/Modèle/Monstre.cs | 4 ++-- Sources/Modèle/User.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Modèle/Monstre.cs b/Sources/Modèle/Monstre.cs index 3dd77ba..aafc51b 100644 --- a/Sources/Modèle/Monstre.cs +++ b/Sources/Modèle/Monstre.cs @@ -16,13 +16,13 @@ public class Monstre public List CharacteristicsList { - get; private init; + get; init; } public List AppearanceList { - get; private init; + get; init; } public Monstre(int id, string name, string danger, string desc, List characList, List appearList) diff --git a/Sources/Modèle/User.cs b/Sources/Modèle/User.cs index b743321..7c00f21 100644 --- a/Sources/Modèle/User.cs +++ b/Sources/Modèle/User.cs @@ -23,6 +23,7 @@ namespace Model public User(string pseudo, string nom, string prenom, string mdp, List? monstresVus = null) { + if (string.IsNullOrWhiteSpace(pseudo) || string.IsNullOrWhiteSpace(nom) || string.IsNullOrWhiteSpace(prenom) || string.IsNullOrWhiteSpace(mdp)) { throw new ArgumentException("Un User doit avoir un pseudo, un nom, un prénom et un mot de passe au minimum !");