From b244118710b27b5df98620c8359a10fe7350bbaf Mon Sep 17 00:00:00 2001 From: Leana BESSON Date: Thu, 11 May 2023 11:23:33 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20classe=20Zootheque.=20Ajout?= =?UTF-8?q?=20de=20la=20m=C3=A9thode=20AfficherListeAnimaux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Solution/Wikipet's/Console/Program.cs | 5 ++++- Solution/Wikipet's/Model/Zootheque.cs | 26 ++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Solution/Wikipet's/Model/Zootheque.cs diff --git a/Solution/Wikipet's/Console/Program.cs b/Solution/Wikipet's/Console/Program.cs index 0d586f8..a1475d2 100644 --- a/Solution/Wikipet's/Console/Program.cs +++ b/Solution/Wikipet's/Console/Program.cs @@ -6,7 +6,8 @@ using System.Runtime.InteropServices; namespace MyProject; class Program { - public static Especetheque Especetheque { get; set; } = Stub.LaodEspecetheque(); + public static Especetheque Especetheque { get; } = Stub.LaodEspecetheque(); + public static Zootheque Zootheque { get; set; } = new Zootheque(); static void Main(string[] args) { @@ -93,6 +94,8 @@ class Program switch (choix) { case 1: + Console.Clear(); + Zootheque.AfficherZootheque(); break; case 2: break; diff --git a/Solution/Wikipet's/Model/Zootheque.cs b/Solution/Wikipet's/Model/Zootheque.cs new file mode 100644 index 0000000..8c9f1aa --- /dev/null +++ b/Solution/Wikipet's/Model/Zootheque.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Model +{ + public class Zootheque + { + HashSet ListeAnimaux = new HashSet(); + + public Zootheque() + { + } + + public void AfficherZootheque() + { + Console.WriteLine("VOS ANIMAUX : "); + foreach (Animal animal in ListeAnimaux) + { + Console.WriteLine(animal.Nom); + } + } + } +}