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.
SAE_2.01_JEU_DE_DAME/Dames/Console/Program.cs

69 lines
1.4 KiB

// See https://aka.ms/new-console-template for more information
using Models.Events;
using Models.Jeux;
using Models;
using Models.Jeux.Plateau;
using System.ComponentModel.DataAnnotations;
Display d = new Display();
Joueur joueur1 = new Joueur();
Joueur joueur2 = new Joueur();
Partie partie = new Partie(joueur1, joueur2);
partie.Plateau.ShowingBoard += d.AfficherPlateau;
partie.Plateau.MovingPawn += d.faireCoup;
joueur1.EnterPlayerName += d.EntrerNoms;
joueur2.EnterPlayerName += d.EntrerNoms;
partie.JoueurCourrant.ShowingPlayerName += d.AfficherNomJoueur;
partie.ShowingWinner += d.AfficherGagnant;
joueur1.EntrerPlayerName();
joueur2.EntrerPlayerName();
if (partie.JoueurCourrant == null)
{ partie.JoueurCourrant = joueur1; }
joueur1.AfficherPlayerName();
Console.WriteLine(" commence !");
partie.Plateau.AfficherPlateau();
while (partie.Agagner()==0)
{
partie.Plateau.MovePawn(partie.JoueurCourrant);
partie.Plateau.AfficherPlateau();
if (partie.Agagner() == 1 || partie.Agagner()== 2)
{
partie.AfficherGagnant();
}
else
{
if (partie.JoueurCourrant == joueur1)
partie.JoueurCourrant = joueur2;
else
partie.JoueurCourrant = joueur1;
}
}