// ******************** MOUVEMENT POSSIBLE ********************** /* * private void Buttons_MouseEnter(object sender, EventArgs e) * { * if (sender is monBouton) * { * monBouton b = sender as monBouton; // cast necessaire * for (int i = 0; i < piece.GetDepi().GetLength(0); ++i) * { * DD.GetMonBouton(b.getNumLigne() + piece.GetDepi()[i], b.getNumCol() + piece.GetDepi()[i]).Text = "X"; * } * } * * } * * private void Buttons_MouseLeave(object sender, EventArgs e) * { * if (sender is Button) * { * monBouton b = sender as monBouton; * for (int i = 0; i < piece.GetDepi().GetLength(0); ++i) * { * DD.GetMonBouton(b.getNumLigne() + piece.GetDepi()[i], b.getNumCol() + piece.GetDepi()[i]).Text = ""; * } * } * } */ // ******************** AFFICHER CIBLE POSSIBLE ********************** private void CibleAj(monBouton b, Cavalier p) { for (int i = 0; i < p.GetDepi().GetLength(0); ++i) { DD.SetButtonCible(b, piece.GetDepi()[i], piece.GetDepj()[i]); } }