} //0 9 public static void Move(Pieces p, int x, int y) { int pos = Getposition(x, y); int xini = p.Position.x; int yini = p.Position.y; int posini = Getposition(xini, yini); if (cases[pos].occupant != null) { Destroy(cases[pos].occupant, x, y); } cases[posini].occupant = null; cases[pos].occupant = p; }
public bool est_echec(Teams ennemies) { Pieces p = Piecesliste[0];//c le roi foreach (Pieces ennemi in ennemies.Piecesliste) { foreach (var pos in ennemi.deplacement) { if (pos == p.Position) { return(true); } } } return(false); }
public static void Destroy(Pieces p, int x, int y) { p = null; }