diff --git a/Solution/Wikipet's/Console/Program.cs b/Solution/Wikipet's/Console/Program.cs index 3e60e7a..0d586f8 100644 --- a/Solution/Wikipet's/Console/Program.cs +++ b/Solution/Wikipet's/Console/Program.cs @@ -59,9 +59,11 @@ class Program switch (choix) { case 1: + Console.Clear(); Especetheque.AfficherListeEspece(); break; case 2: + Console.Clear(); Especetheque.SelectionnerEspece(); break; case 9: diff --git a/Solution/Wikipet's/Model/Espece.cs b/Solution/Wikipet's/Model/Espece.cs index 0ec7739..24ba4db 100644 --- a/Solution/Wikipet's/Model/Espece.cs +++ b/Solution/Wikipet's/Model/Espece.cs @@ -15,15 +15,16 @@ namespace Model public string EsperanceVie { get; } public string PoidsMoyen { get; } public string TailleMoyenne { get; } - //public string Comportement { get; } - //public string Sante { get; } - //public string Education { get; } - //public string Entretien { get; } - //public string Cout { get; } - //public string Conseil { get; } public HashSet? ListeRaces { get; } = new HashSet(); + public string Comportement { get; } + public string Sante { get; } + public string Education { get; } + public string Entretien { get; } + public string Cout { get; } + public string Conseil { get; } + - public Espece(string nom = "Inconnu", string nomScientifique = "Inconnu", string esperanceVie = "Inconnue", string poidsMoyen = "Inconnu", string tailleMoyenne = "Inconnue", HashSet? races = null) + public Espece(string nom = "Inconnu", string nomScientifique = "Inconnu", string esperanceVie = "Inconnue", string poidsMoyen = "Inconnu", string tailleMoyenne = "Inconnue", HashSet? races = null, string comportement = "Inconnu", string sante = "Inconnue", string education = "Inconnue", string entretien = "Inconnu", string cout = "Inconnu", string conseil = "Aucun conseil") { Nom = nom; NomScientifique = nomScientifique; @@ -31,6 +32,12 @@ namespace Model PoidsMoyen = poidsMoyen; TailleMoyenne = tailleMoyenne; ListeRaces = races; + Comportement = comportement; + Sante = sante; + Education = education; + Entretien = entretien; + Cout = cout; + Conseil = conseil; } internal void AffficherListeRace() @@ -54,6 +61,12 @@ namespace Model Console.WriteLine("\tEspérance de vie : " + EsperanceVie); Console.WriteLine("\tPoids moyen : " + PoidsMoyen); Console.WriteLine("\tTaille moyenne : " + TailleMoyenne); + Console.WriteLine("\tComportement : " + Comportement); + Console.WriteLine("\tSanté : " + Sante); + Console.WriteLine("\tEducation : " + Education); + Console.WriteLine("\tEntretien : " + Entretien); + Console.WriteLine("\tCout : " + Cout); + Console.WriteLine("\tConseil : " + Conseil); AffficherListeRace(); @@ -107,7 +120,7 @@ namespace Model { race.AfficherRace(); } - else Console.WriteLine("\tChoix incorrect"); + else Console.WriteLine("\tChoix incorrect\n"); } } } diff --git a/Solution/Wikipet's/Model/Especetheque.cs b/Solution/Wikipet's/Model/Especetheque.cs index 0fbb440..fc51d35 100644 --- a/Solution/Wikipet's/Model/Especetheque.cs +++ b/Solution/Wikipet's/Model/Especetheque.cs @@ -18,7 +18,6 @@ namespace Model public void AfficherListeEspece() { - Console.Clear(); Console.WriteLine("LISTE DES ESPECES : "); foreach (Espece espece in ListeEspeces) { @@ -41,8 +40,6 @@ namespace Model public void SelectionnerEspece() { - Console.Clear(); - string choix = ""; while (choix != "-1") { @@ -57,7 +54,7 @@ namespace Model { espece.AfficherEspece(); } - else Console.WriteLine("\tChoix incorrect"); + else Console.WriteLine("\tChoix incorrect\n"); } } }