SteamWar/BauSystem2.0
Archiviert
12
0

Add new BauGuiImportExport.exportGui

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-05-24 22:55:00 +02:00
Ursprung 3b8d7f1316
Commit 7e40e4ab63

Datei anzeigen

@ -36,19 +36,14 @@ public class BauGuiImportExport {
append(st, Integer.toBinaryString(mapping.getSize() / 9), 3); // Menu Size append(st, Integer.toBinaryString(mapping.getSize() / 9), 3); // Menu Size
Map<Integer, Integer> map = new HashMap<>(); Map<Integer, Integer> map = new HashMap<>();
mapping.getMapping().forEach((integer, integer2) -> { mapping.getMapping().forEach((integer, integer2) -> map.put(integer2, integer));
map.put(integer2, integer);
});
List<Integer> integerList = map.keySet().stream().sorted().collect(Collectors.toList()); List<Integer> integerList = map.keySet().stream().sorted().collect(Collectors.toList());
for (int i = 0; i < integerList.size(); i++) { for (int i = 0; i < integerList.size(); i++) {
int current = integerList.get(i); int current = integerList.get(i);
int last = 0; int last = i == 0 ? 0 : integerList.get(i - 1);
if (i != 0) {
last = integerList.get(i - 1);
}
if (current - last > 1) { if (current - last > 1) {
binaryConvert(st, Integer.toBinaryString(current - last), 3, '0'); binaryConvert(st, Integer.toBinaryString(current - last - 1), 3, '0');
} }
binaryConvert(st, Integer.toBinaryString(map.get(current)), 4, '1'); binaryConvert(st, Integer.toBinaryString(map.get(current)), 4, '1');
} }