diff --git a/Sources/ConsoleApp/Program.cs b/Sources/ConsoleApp/Program.cs index e69de29..3c85a5e 100644 --- a/Sources/ConsoleApp/Program.cs +++ b/Sources/ConsoleApp/Program.cs @@ -0,0 +1,4 @@ +using CoreLibrary; + +Partie maPartie = new Partie(new ReglesClassiques()); +maPartie.Jouer(); diff --git a/Sources/CoreLibrary/Code.cs b/Sources/CoreLibrary/Code.cs index c23f278..27bf7d4 100644 --- a/Sources/CoreLibrary/Code.cs +++ b/Sources/CoreLibrary/Code.cs @@ -37,8 +37,6 @@ public Jeton RecupererJeton(int indice) { - if(indice < 0 || indice > TailleMaximale()) - throw new CodeIndiceHorsDePorteeException(); Jeton? jeton = lesJetons[indice]; diff --git a/Sources/CoreLibrary/Partie.cs b/Sources/CoreLibrary/Partie.cs index ecb4b1c..fb61c2c 100644 --- a/Sources/CoreLibrary/Partie.cs +++ b/Sources/CoreLibrary/Partie.cs @@ -17,24 +17,43 @@ while (!regles.EstTerminee()) { - // ?? + Joueur joueurCourant = regles.JoueurCourant(); + Plateau plateauCourant = joueurCourant.Plateau; + + Code code = regles.GenererCode(); + + while (!code.EstComplet()) + { + AjouterJeton(code); + } + plateauCourant.AjouterCode(code); + + regles.PasserLaMain(); } PartieTerminee(); } + private void AjouterJeton(Code code) + { + Jeton jeton = new Jeton(Couleur.ROUGE); + code.AjouterJeton(jeton); + } + private void DefinirJoueurs() { while(regles.NbJoueurs != regles.NbJoueursMaximum) { - // + string nom = "pauline"; + regles.AjouterJoueur(nom); } } private void PartieTerminee() { - + regles.Gagnants(); + regles.Perdants(); }