Ajout des derniers attributs de Espece. ESPECES FONCTIONNELS ET TERMINER ACTUELLEMENT.
continuous-integration/drone/push Build is failing Details

pull/18/head
Leana BESSON 2 years ago
parent 582abdf7c7
commit 515d2158a0

@ -59,9 +59,11 @@ class Program
switch (choix) switch (choix)
{ {
case 1: case 1:
Console.Clear();
Especetheque.AfficherListeEspece(); Especetheque.AfficherListeEspece();
break; break;
case 2: case 2:
Console.Clear();
Especetheque.SelectionnerEspece(); Especetheque.SelectionnerEspece();
break; break;
case 9: case 9:

@ -15,15 +15,16 @@ namespace Model
public string EsperanceVie { get; } public string EsperanceVie { get; }
public string PoidsMoyen { get; } public string PoidsMoyen { get; }
public string TailleMoyenne { 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<Race>? ListeRaces { get; } = new HashSet<Race>(); public HashSet<Race>? ListeRaces { get; } = new HashSet<Race>();
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<Race>? races = null)
public Espece(string nom = "Inconnu", string nomScientifique = "Inconnu", string esperanceVie = "Inconnue", string poidsMoyen = "Inconnu", string tailleMoyenne = "Inconnue", HashSet<Race>? races = null, string comportement = "Inconnu", string sante = "Inconnue", string education = "Inconnue", string entretien = "Inconnu", string cout = "Inconnu", string conseil = "Aucun conseil")
{ {
Nom = nom; Nom = nom;
NomScientifique = nomScientifique; NomScientifique = nomScientifique;
@ -31,6 +32,12 @@ namespace Model
PoidsMoyen = poidsMoyen; PoidsMoyen = poidsMoyen;
TailleMoyenne = tailleMoyenne; TailleMoyenne = tailleMoyenne;
ListeRaces = races; ListeRaces = races;
Comportement = comportement;
Sante = sante;
Education = education;
Entretien = entretien;
Cout = cout;
Conseil = conseil;
} }
internal void AffficherListeRace() internal void AffficherListeRace()
@ -54,6 +61,12 @@ namespace Model
Console.WriteLine("\tEspérance de vie : " + EsperanceVie); Console.WriteLine("\tEspérance de vie : " + EsperanceVie);
Console.WriteLine("\tPoids moyen : " + PoidsMoyen); Console.WriteLine("\tPoids moyen : " + PoidsMoyen);
Console.WriteLine("\tTaille moyenne : " + TailleMoyenne); 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(); AffficherListeRace();
@ -107,7 +120,7 @@ namespace Model
{ {
race.AfficherRace(); race.AfficherRace();
} }
else Console.WriteLine("\tChoix incorrect"); else Console.WriteLine("\tChoix incorrect\n");
} }
} }
} }

@ -18,7 +18,6 @@ namespace Model
public void AfficherListeEspece() public void AfficherListeEspece()
{ {
Console.Clear();
Console.WriteLine("LISTE DES ESPECES : "); Console.WriteLine("LISTE DES ESPECES : ");
foreach (Espece espece in ListeEspeces) foreach (Espece espece in ListeEspeces)
{ {
@ -41,8 +40,6 @@ namespace Model
public void SelectionnerEspece() public void SelectionnerEspece()
{ {
Console.Clear();
string choix = ""; string choix = "";
while (choix != "-1") while (choix != "-1")
{ {
@ -57,7 +54,7 @@ namespace Model
{ {
espece.AfficherEspece(); espece.AfficherEspece();
} }
else Console.WriteLine("\tChoix incorrect"); else Console.WriteLine("\tChoix incorrect\n");
} }
} }
} }

Loading…
Cancel
Save