public static boolean CheckKingThreat(ChessPieceBase[][] TheBoard, boolean WhiteMove){
        int KingLocationX=0,KingLocationY=0;
        for (int a=0;a<8;a++){
            for (int b=0;b<8;b++){
                if (TheBoard[a][b]instanceof KingPiece&& TheBoard[a][b].isWhite==WhiteMove){
                    KingLocationX=a;
                    KingLocationY=b;
                }
            }
        }
        for (int a=0;a<8;a++)
            for (int b = 0; b < 8; b++) {
                if (TheBoard[a][b].isWhite != WhiteMove) {
                    if (TheBoard[a][b].isValidMove(KingLocationX, KingLocationY, a, b)) {
                        return true;
                    }
                }
            }
        return false;
    }