diff options
| author | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-25 15:37:57 +0900 |
|---|---|---|
| committer | syeyoung <42869671+cyoung06@users.noreply.github.com> | 2020-11-25 15:37:57 +0900 |
| commit | 81a315f025f361d1155305e55dfee29308a74ed3 (patch) | |
| tree | 9be59a599ef9821ca9e66005207cee32022e5a4f /src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder | |
| parent | a49e2c1970f6f77079a860dd5e92741251f41c9c (diff) | |
| download | Skyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.tar.gz Skyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.tar.bz2 Skyblock-Dungeons-Guide-81a315f025f361d1155305e55dfee29308a74ed3.zip | |
room processor stuff
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder')
| -rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java index cd174660..7e8c43e0 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/roomfinder/DungeonRoom.java @@ -5,6 +5,9 @@ import kr.syeyoung.dungeonsguide.dungeon.DungeonContext; import kr.syeyoung.dungeonsguide.dungeon.MapProcessor; import kr.syeyoung.dungeonsguide.dungeon.data.DungeonRoomInfo; import kr.syeyoung.dungeonsguide.dungeon.doorfinder.DungeonDoor; +import kr.syeyoung.dungeonsguide.roomprocessor.ProcessorFactory; +import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessor; +import kr.syeyoung.dungeonsguide.roomprocessor.RoomProcessorGenerator; import lombok.Getter; import net.minecraft.block.Block; import net.minecraft.util.BlockPos; @@ -33,6 +36,9 @@ public class DungeonRoom { private final int unitWidth; // X private final int unitHeight; // Z + + private RoomProcessor roomProcessor; + public DungeonRoom(List<Point> points, short shape, byte color, BlockPos min, BlockPos max, DungeonContext context) { this.unitPoints = points; this.shape = shape; @@ -40,8 +46,6 @@ public class DungeonRoom { this.min = min; this.max = max; this.context = context; - buildDoors(); - buildRoom(); minRoomPt = new Point(Integer.MAX_VALUE, Integer.MAX_VALUE); for (Point pt : unitPoints) { @@ -50,6 +54,11 @@ public class DungeonRoom { } unitWidth = (int) Math.ceil(max.getX() - min.getX() / 32.0); unitHeight = (int) Math.ceil(max.getZ() - min.getZ() / 32.0); + + + buildDoors(); + buildRoom(); + updateRoomProcessor(); } private static final Set<Vector2d> directions = Sets.newHashSet(new Vector2d(0,16), new Vector2d(0, -16), new Vector2d(16, 0), new Vector2d(-16 , 0)); @@ -81,6 +90,12 @@ public class DungeonRoom { this.dungeonRoomInfo = dungeonRoomInfo; } + public void updateRoomProcessor() { + RoomProcessorGenerator roomProcessorGenerator = ProcessorFactory.getRoomProcessorGenerator(dungeonRoomInfo.getProcessorId()); + if (roomProcessorGenerator == null) this.roomProcessor = null; + else this.roomProcessor = roomProcessorGenerator.createNew(this); + } + public Block getAbsoluteBlockAt(int x, int y, int z) { // validate x y z's BlockPos pos = new BlockPos(x,y,z); |
