public TreeNode Apply(Point op) { int player; int other; if (p.WhiteTurn) { player = 0; other = 1; } else { player = 1; other = 0; } //int player = p.WhiteTurn ? 1 : 0; //int other = p.WhiteTurn ? 0 : 1; for (int i = -1; i <= 1; i++) { for (int j = -1; j <= 1; j++) { //we need to skip the one with no deplacement if (i != 0 || j != 0) { foreach (Point p in p.CheckDirection(op.Y + i, op.X + j, player, other, nodeBoard, i, j)) { nodeBoard[p.X, p.Y] = player; } //we place the new piece nodeBoard[op.X, op.Y] = player; } } } TreeNode next = new TreeNode(p, nodeBoard); return(next); }