public boolean isStalemated(boolean isWhite) {
		Piece piece = null;
		int row = 0;
		int col = 0;
		int numMoves = 0;
		boolean result = false;
		Piece king = null;
		ArrayList<Move>legalMoves = new ArrayList<Move>();
		while (row < 8 && numMoves == 0) {
			col = 0;
			while (col < 8 && numMoves == 0) {
				piece = boardController.getPieceByCoords(row, col);
				if (piece != null) {
					if ((isWhite == piece.isWhite())) {
						numMoves += findMoves(legalMoves, row, col).size();
					}
				}
				col++;
			}
			row++;
		}

		if (numMoves == 0) {
			king = controller.getAI().findKing(isWhite);

			// If the king's square is attacked, it's checkmate, not stalemate.
			if (!RuleEngine.isAttackedSquare(king.getRow(), king.getCol(),
					isWhite))
				
			result = true;
		}

		if (result)
			System.out.println("MoveGenerator.isStaleMated: StalemateDetected");
		return result;
	}