|
|
|
@ -36,11 +36,15 @@ namespace Model
|
|
|
|
|
internal void AffficherListeRace()
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("\nLISTE DES RACES : ");
|
|
|
|
|
foreach (Race race in ListeRaces)
|
|
|
|
|
if (ListeRaces != null)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("\t" + race.Nom + " (" + race.NomScientifique + ")");
|
|
|
|
|
foreach (Race race in ListeRaces)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("\t" + race.Nom + " (" + race.NomScientifique + ")");
|
|
|
|
|
}
|
|
|
|
|
Console.WriteLine("\n");
|
|
|
|
|
}
|
|
|
|
|
Console.WriteLine("\n");
|
|
|
|
|
else Console.WriteLine("\tAucune race connue.\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void AfficherEspece()
|
|
|
|
@ -51,7 +55,61 @@ namespace Model
|
|
|
|
|
Console.WriteLine("\tPoids moyen : " + PoidsMoyen);
|
|
|
|
|
Console.WriteLine("\tTaille moyenne : " + TailleMoyenne);
|
|
|
|
|
|
|
|
|
|
AffficherListeRace();
|
|
|
|
|
AffficherListeRace();
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("\n\t1- Sélectionner une race");
|
|
|
|
|
Console.WriteLine("\t9- Retour");
|
|
|
|
|
|
|
|
|
|
Console.Write("\n\tEntrer votre choix : ");
|
|
|
|
|
int decision = Convert.ToInt32(Console.ReadLine());
|
|
|
|
|
|
|
|
|
|
switch (decision)
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
SelectionnerRace();
|
|
|
|
|
break;
|
|
|
|
|
case 9:
|
|
|
|
|
return;
|
|
|
|
|
default:
|
|
|
|
|
Console.WriteLine("\tChoix incorrect\n");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Race? RechercherRace(string choix)
|
|
|
|
|
{
|
|
|
|
|
foreach (Race race in ListeRaces)
|
|
|
|
|
{
|
|
|
|
|
if (race.Nom == choix)
|
|
|
|
|
{
|
|
|
|
|
return race;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void SelectionnerRace ()
|
|
|
|
|
{
|
|
|
|
|
string choix = "";
|
|
|
|
|
while (choix != "-1")
|
|
|
|
|
{
|
|
|
|
|
Console.Write("\n\tEntrer le nom de la race à sélectionner (-1 pour annuler) : ");
|
|
|
|
|
choix = Console.ReadLine();
|
|
|
|
|
|
|
|
|
|
if (choix != "-1")
|
|
|
|
|
{
|
|
|
|
|
Race race = RechercherRace(choix);
|
|
|
|
|
|
|
|
|
|
if (race != null)
|
|
|
|
|
{
|
|
|
|
|
race.AfficherRace();
|
|
|
|
|
}
|
|
|
|
|
else Console.WriteLine("\tChoix incorrect");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|