Début de la classe Partie et des évenments
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
parent
254c6c8440
commit
b0a2d916d4
@ -1,88 +0,0 @@
|
||||
using CoreLibrary;
|
||||
using ConsoleApp;
|
||||
|
||||
|
||||
|
||||
Console.OutputEncoding = System.Text.Encoding.UTF8;
|
||||
|
||||
ReglesClassiques partie = new ReglesClassiques();
|
||||
|
||||
Utils.AfficherTitre();
|
||||
|
||||
Utils.AfficherTitre("Joueurs");
|
||||
|
||||
string joueur1;
|
||||
string joueur2;
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
joueur1 = Utils.SaisirNom();
|
||||
break;
|
||||
}
|
||||
catch(UtilsNomJoueurNullException)
|
||||
{
|
||||
Console.WriteLine("Nom invalide pour le joueur ! Ressaisir le nom");
|
||||
}
|
||||
}
|
||||
|
||||
while (true)
|
||||
{
|
||||
try
|
||||
{
|
||||
joueur2 = Utils.SaisirNom();
|
||||
break;
|
||||
}
|
||||
catch (UtilsNomJoueurNullException)
|
||||
{
|
||||
Console.WriteLine("Nom invalide pour le joueur 2 ! Ressaisir le nom");
|
||||
}
|
||||
}
|
||||
|
||||
Utils.AfficherSeparateur();
|
||||
|
||||
partie.AjouterJoueur(joueur1);
|
||||
partie.AjouterJoueur(joueur2);
|
||||
|
||||
partie.CommencerLaPartie();
|
||||
|
||||
while (!partie.EstTerminee())
|
||||
{
|
||||
Console.WriteLine(partie.JoueurCourant().Nom);
|
||||
Console.WriteLine();
|
||||
|
||||
Utils.DessinerPlateau(partie.JoueurCourant().Plateau.Grille(), partie.JoueurCourant().Plateau.Indicateurs());
|
||||
Console.WriteLine();
|
||||
|
||||
Code code = partie.GenererCode();
|
||||
|
||||
Utils.ChoixCode(ref code);
|
||||
|
||||
partie.JoueurCourant().Plateau.AjouterCode(code);
|
||||
|
||||
partie.PasserLaMain();
|
||||
|
||||
Utils.AfficherSeparateur();
|
||||
}
|
||||
|
||||
Console.WriteLine("La partie est maintenant terminée !");
|
||||
|
||||
Joueur[] gagnants = partie.Gagnants().ToArray();
|
||||
Joueur[] perdants = partie.Perdants().ToArray();
|
||||
|
||||
|
||||
|
||||
if (gagnants.Length > 1)
|
||||
{
|
||||
Console.WriteLine("C'est une égalité !");
|
||||
}
|
||||
else if (gagnants.Length == 1)
|
||||
{
|
||||
Console.WriteLine($"C'est une victoire de {gagnants[0].Nom}." +
|
||||
$"");
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("C'est une défaite...");
|
||||
}
|
Loading…
Reference in new issue