Ejemplo n.º 1
0
 private static void insert(final int mapY, final int mustBePlain, final int... emptyOrPlain) {
   final short patchId = PartitionPatch.getPatchIdFromMapCoord(1, mapY);
   BorderHelper.BORDER_PATCHES.put(mustBePlain, patchId);
   for (final int optional : emptyOrPlain) {
     insert(mapY, mustBePlain | optional, new int[0]);
     insert(mapY, mustBePlain | optional, allExcept(emptyOrPlain, optional));
   }
 }
Ejemplo n.º 2
0
 private static boolean isEmptyPatchOrEntryBorder(
     final short[][] patches, final int x, final int y) {
   return isEmptyPatch(patches, x, y)
       || PartitionPatch.getMapCoordFromPatchId(patches[x][y]).getX() == 2;
 }
Ejemplo n.º 3
0
 public static short getPatchIdForMask(final int mask) {
   if (!BorderHelper.BORDER_PATCHES.contains(mask)) {
     return PartitionPatch.getPatchIdFromMapCoord(1, 0);
   }
   return BorderHelper.BORDER_PATCHES.get(mask);
 }