|
|
@ -14,12 +14,14 @@ namespace CoreLibrary
|
|
|
|
public event EventHandler<PartieDemanderJoueurEventArgs>? PartieDemanderJoueur;
|
|
|
|
public event EventHandler<PartieDemanderJoueurEventArgs>? PartieDemanderJoueur;
|
|
|
|
public event EventHandler<PartieDebutPartieEventArgs>? PartieDebutPartie;
|
|
|
|
public event EventHandler<PartieDebutPartieEventArgs>? PartieDebutPartie;
|
|
|
|
public event EventHandler<PartieDemanderJoueurJouerEventArgs>? PartieDemanderJoueurJouer;
|
|
|
|
public event EventHandler<PartieDemanderJoueurJouerEventArgs>? PartieDemanderJoueurJouer;
|
|
|
|
|
|
|
|
public event EventHandler<PartieNouveauTourEventArgs>? PartieNouveauTour;
|
|
|
|
public event EventHandler<PartiePasserLaMainEventArgs>? PartiePasserLaMain;
|
|
|
|
public event EventHandler<PartiePasserLaMainEventArgs>? PartiePasserLaMain;
|
|
|
|
public event EventHandler<PartiePartieTermineeEventArgs>? PartiePartieTerminee;
|
|
|
|
public event EventHandler<PartiePartieTermineeEventArgs>? PartiePartieTerminee;
|
|
|
|
|
|
|
|
|
|
|
|
private void QuandPartieDemanderJoueur(Joueur joueurDemande) => PartieDemanderJoueur?.Invoke(this, new PartieDemanderJoueurEventArgs(joueurs.Count + 1, joueurDemande));
|
|
|
|
private void QuandPartieDemanderJoueur(Joueur joueurDemande) => PartieDemanderJoueur?.Invoke(this, new PartieDemanderJoueurEventArgs(joueurs.Count + 1, joueurDemande));
|
|
|
|
private void QuandPartieDebutPartie() => PartieDebutPartie?.Invoke(this, new PartieDebutPartieEventArgs());
|
|
|
|
private void QuandPartieDebutPartie() => PartieDebutPartie?.Invoke(this, new PartieDebutPartieEventArgs());
|
|
|
|
private void QuandPartieDemanderJoueurJouer() => PartieDemanderJoueurJouer?.Invoke(this, new PartieDemanderJoueurJouerEventArgs(Tour, Joueurs.ElementAt(courant), plateaux.ElementAt(courant), new Code(Regles.TailleCode), joueurs[Joueurs.ElementAt(courant)]));
|
|
|
|
private void QuandPartieDemanderJoueurJouer(Code code) => PartieDemanderJoueurJouer?.Invoke(this, new PartieDemanderJoueurJouerEventArgs(Tour, Joueurs.ElementAt(courant), plateaux.ElementAt(courant), code, joueurs[Joueurs.ElementAt(courant)]));
|
|
|
|
|
|
|
|
private void QuandPartieNouveauTour(Code code) => PartieNouveauTour?.Invoke(this, new PartieNouveauTourEventArgs(Tour, Joueurs.ElementAt(courant), plateaux.ElementAt(courant), code, joueurs[Joueurs.ElementAt(courant)]));
|
|
|
|
private void QuandPartiePasserLaMain() => PartiePasserLaMain?.Invoke(this, new PartiePasserLaMainEventArgs(Joueurs.ElementAt(courant)));
|
|
|
|
private void QuandPartiePasserLaMain() => PartiePasserLaMain?.Invoke(this, new PartiePasserLaMainEventArgs(Joueurs.ElementAt(courant)));
|
|
|
|
private void QuandPartiePartieTerminee(IReadOnlyList<string> gagnants, IReadOnlyList<string> perdants) => PartiePartieTerminee?.Invoke(this, new PartiePartieTermineeEventArgs(gagnants, perdants));
|
|
|
|
private void QuandPartiePartieTerminee(IReadOnlyList<string> gagnants, IReadOnlyList<string> perdants) => PartiePartieTerminee?.Invoke(this, new PartiePartieTermineeEventArgs(gagnants, perdants));
|
|
|
|
|
|
|
|
|
|
|
@ -55,6 +57,7 @@ namespace CoreLibrary
|
|
|
|
partie.PartieDemanderJoueur = null;
|
|
|
|
partie.PartieDemanderJoueur = null;
|
|
|
|
partie.PartieDebutPartie = null;
|
|
|
|
partie.PartieDebutPartie = null;
|
|
|
|
partie.PartieDemanderJoueurJouer = null;
|
|
|
|
partie.PartieDemanderJoueurJouer = null;
|
|
|
|
|
|
|
|
partie.PartieNouveauTour = null;
|
|
|
|
partie.PartiePasserLaMain = null;
|
|
|
|
partie.PartiePasserLaMain = null;
|
|
|
|
partie.PartiePartieTerminee = null;
|
|
|
|
partie.PartiePartieTerminee = null;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -109,7 +112,10 @@ namespace CoreLibrary
|
|
|
|
|
|
|
|
|
|
|
|
private void NouveauTour()
|
|
|
|
private void NouveauTour()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QuandPartieDemanderJoueurJouer();
|
|
|
|
Code code = new Code(Regles.TailleCode);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QuandPartieDemanderJoueurJouer(code);
|
|
|
|
|
|
|
|
QuandPartieNouveauTour(code);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void PlateauAjouterCode(object? sender, PlateauAjouterCodeEventArgs e)
|
|
|
|
private void PlateauAjouterCode(object? sender, PlateauAjouterCodeEventArgs e)
|
|
|
|