aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-25 12:26:38 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-11-25 12:26:38 +0900
commita49e2c1970f6f77079a860dd5e92741251f41c9c (patch)
tree423d8d4ba751559e48cdb34fd1a7baf7e616ab2d /src/main/java/kr/syeyoung/dungeonsguide/dungeon
parentbbec09457a7de298834aaa6caac0c24b5fe5917d (diff)
downloadSkyblock-Dungeons-Guide-a49e2c1970f6f77079a860dd5e92741251f41c9c.tar.gz
Skyblock-Dungeons-Guide-a49e2c1970f6f77079a860dd5e92741251f41c9c.tar.bz2
Skyblock-Dungeons-Guide-a49e2c1970f6f77079a860dd5e92741251f41c9c.zip
room matching and better gui
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
index c64d15f1..626b75b4 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/RoomMatcher.java
@@ -14,7 +14,7 @@ public class RoomMatcher {
@Getter
private DungeonRoomInfo match;
@Getter
- private int rotation;
+ private int rotation; // how much the "found room" has to rotate to match the given dungeon room info. !
private boolean triedMatch = false;
public RoomMatcher(DungeonRoom dungeonRoom) {
@@ -75,17 +75,17 @@ public class RoomMatcher {
int minX = dungeonRoom.getMin().getX();
int minZ = dungeonRoom.getMin().getZ();
int y = dungeonRoom.getMin().getY();
- int widthX = maxX - minX;
- int heightZ = maxZ - minZ;
- int[][] data = new int[dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 1][dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() +1];
+ int widthX = maxX - minX + 2;
+ int heightZ = maxZ - minZ + 2;
+ int[][] data = new int[dungeonRoom.getMax().getZ() - dungeonRoom.getMin().getZ() +2][dungeonRoom.getMax().getX() - dungeonRoom.getMin().getX() + 2];
for (int z = 0; z < data.length; z++) {
for (int x = 0; x < data[0].length; x++) {
- if (!(offset <= x && widthX - offset >= x && offset <= z && heightZ - offset >= z)) {
+ if (!(offset <= x && widthX - offset > x && offset <= z && heightZ - offset > z)) {
data[z][x] = -1;
continue;
}
- if (!(dungeonRoom.canAccessRelative(x + offset, z + offset) && dungeonRoom.canAccessRelative(x - offset, z - offset))) {
+ if (!(dungeonRoom.canAccessRelative(x + offset - 1, z + offset - 1) && dungeonRoom.canAccessRelative(x - offset, z - offset))) {
data[z][x] = -1;
continue;
}