public ArrayList<FriendlyPiece> getMovablePieces() {
        ArrayList<FriendlyPiece> movablePieces = new ArrayList<>();
        for (int i = 0; i < squares.length; i++) {
            for (int j = 0; j < squares[i].length; j++) {
                Square square = squares[i][j];
                if (square.isOccupied()
                        && square.getOccupier() instanceof FriendlyPiece) {
                    FriendlyPiece p = (FriendlyPiece) square.getOccupier();
                    if (p instanceof FriendlyPiece
                            && ((FriendlyPiece) p).getRank() != Rank.BOMB
                            && ((FriendlyPiece) p).getRank() != Rank.FLAG) {

                        movablePieces.add(p);
                    }
                }
            }
        }
        return movablePieces;
    }