for (int i = 0; i < piecesTopLeftCorners.length; i++) {
if (new Rectangle(topLeftBoardPosition.x + (i % 9) * squareWidth - pieceRadius,
topLeftBoardPosition.y + (i / 9) * squareWidth - pieceRadius,
2 * pieceRadius,
2 * pieceRadius).contains(e.getPoint())) {
moveContainer.setMove(new Move(movingPiece, i, movingColor));
movingColor = null;
movingPiece = -1;
return;
}
}