Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void SelectChessFigure(int x, int y)
- {
- if (ChessFigurePositions[x, y] == null) return;
- if (ChessFigurePositions[x, y].isWhite != isWhiteTurn) return;
- bool hasAtLeastOneMove = false;
- allowedMoves = ChessFigurePositions[x, y].PossibleMove();
- for(int i = 0; i < 8; i++)
- {
- for(int j = 0; j < 8; j++)
- {
- if(allowedMoves[i,j])
- {
- hasAtLeastOneMove = true;
- i = 7;
- break;
- }
- }
- }
- if (!hasAtLeastOneMove) return;
- selectedFigure = ChessFigurePositions[x, y];
- BoardHighlighting.Instance.HighlightAllowedMoves(allowedMoves);
- }
Add Comment
Please, Sign In to add comment