public boolean allShipsSunk() {
        int count1 = 0; // count how many ships' positions in sea field
        int count2 = 0; // count how many times bomb hits the ship;
        for (int x = 0; x < width; x++) {
            for (int y = 0; y < height; y++) {
                if (!seaPosition[x + y * height].getValue().equals(".")) {
                    count1++;
                    if (bomb[x + y * height].getValue().equals("X")) {
                        count2++;
                    }
                }
            }
        }
        
        if (count1 == count2) {
            return true;
        } else {
            return false;
        }
    }