You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
2.0 KiB
58 lines
2.0 KiB
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace Model
|
|
{
|
|
public class Espece
|
|
{
|
|
public string Nom { get; }
|
|
public string NomScientifique { get; }
|
|
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<Race>? ListeRaces { get; } = new HashSet<Race>();
|
|
|
|
public Espece(string nom = "Inconnu", string nomScientifique = "Inconnu", string esperanceVie = "Inconnue", string poidsMoyen = "Inconnu", string tailleMoyenne = "Inconnue", HashSet<Race>? races = null)
|
|
{
|
|
Nom = nom;
|
|
NomScientifique = nomScientifique;
|
|
EsperanceVie = esperanceVie;
|
|
PoidsMoyen = poidsMoyen;
|
|
TailleMoyenne = tailleMoyenne;
|
|
ListeRaces = races;
|
|
}
|
|
|
|
internal void AffficherListeRace()
|
|
{
|
|
Console.WriteLine("\nLISTE DES RACES : ");
|
|
foreach (Race race in ListeRaces)
|
|
{
|
|
Console.WriteLine("\t" + race.Nom + " (" + race.NomScientifique + ")");
|
|
}
|
|
Console.WriteLine("\n");
|
|
}
|
|
|
|
public void AfficherEspece()
|
|
{
|
|
Console.WriteLine("\n" + Nom);
|
|
Console.WriteLine("\tNom scientifique : " + NomScientifique);
|
|
Console.WriteLine("\tEspérance de vie : " + EsperanceVie);
|
|
Console.WriteLine("\tPoids moyen : " + PoidsMoyen);
|
|
Console.WriteLine("\tTaille moyenne : " + TailleMoyenne);
|
|
|
|
AffficherListeRace();
|
|
}
|
|
}
|
|
}
|