From fb2f4d1d71ea11ebf60b49933bce6ba761a0ef5b Mon Sep 17 00:00:00 2001 From: victor perez ngounou Date: Fri, 28 Oct 2022 07:16:54 +0200 Subject: [PATCH] Done --- Sources/BowlingLib/Model/Frame.cs | 2 +- Sources/BowlingLib/Model/Joueur.cs | 2 ++ Sources/BowlingLib/Model/Partie.cs | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/BowlingLib/Model/Frame.cs b/Sources/BowlingLib/Model/Frame.cs index c262279..351e33a 100644 --- a/Sources/BowlingLib/Model/Frame.cs +++ b/Sources/BowlingLib/Model/Frame.cs @@ -11,7 +11,7 @@ namespace BowlingLib.Model /// /// Classe Model Frame /// - public class Frame:IEquatable + public class Frame:IEquatable { const int MAX_QUILLE = 10; public int Numero diff --git a/Sources/BowlingLib/Model/Joueur.cs b/Sources/BowlingLib/Model/Joueur.cs index 5e43d07..e3975d7 100644 --- a/Sources/BowlingLib/Model/Joueur.cs +++ b/Sources/BowlingLib/Model/Joueur.cs @@ -85,6 +85,8 @@ namespace BowlingLib.Model public void AddPartie(Partie p) { + if(Parties.Contains(p)) + throw new ArgumentException("la partie existe deja"); parties.Add(p); } diff --git a/Sources/BowlingLib/Model/Partie.cs b/Sources/BowlingLib/Model/Partie.cs index 42e46df..30c1bec 100644 --- a/Sources/BowlingLib/Model/Partie.cs +++ b/Sources/BowlingLib/Model/Partie.cs @@ -67,6 +67,8 @@ namespace BowlingLib.Model /// public void AddFrame(Frame frame) { + if (Frames.Contains(frame)) + throw new ArgumentException("Le frame existe déjà"); frames.Add(frame); }