static Vector<BitSet> terrainToBits(TerrainTypes[] arg) {
        int len = arg.length;
        int numBits = TerrainTypes.countBits();
        Vector<BitSet> result = new Vector<>(numBits);
        for (int j=0; j < numBits; j++) {
            BitSet bitset = new BitSet(len);
            bitset.clear();
            result.add(bitset);
        }
        for (int i=0; i < len; i++) {
            BitSet bits = arg[i].getBits();
            for (int j=0; j < numBits; j++) {
                result.get(j).set(i, bits.get(j));
            }
        }
        return result;
    }