diff options
author | syeyoung <cyong06@naver.com> | 2021-02-10 16:52:36 +0900 |
---|---|---|
committer | syeyoung <cyong06@naver.com> | 2021-02-10 16:52:36 +0900 |
commit | 2223e55d5d9c61f4ab93d8dab0b5f9820272c8fe (patch) | |
tree | cb974956664f7402358e1549d3cff35af8a45145 /src/main/java/kr/syeyoung/dungeonsguide | |
parent | 26de881921c351c9b39dfef5e3770e7d042ddd53 (diff) | |
download | Skyblock-Dungeons-Guide-2223e55d5d9c61f4ab93d8dab0b5f9820272c8fe.tar.gz Skyblock-Dungeons-Guide-2223e55d5d9c61f4ab93d8dab0b5f9820272c8fe.tar.bz2 Skyblock-Dungeons-Guide-2223e55d5d9c61f4ab93d8dab0b5f9820272c8fe.zip |
add get all states
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide')
10 files changed, 84 insertions, 2 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java new file mode 100644 index 00000000..b60b8fb0 --- /dev/null +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/tree/ActionRoute.java @@ -0,0 +1,34 @@ +package kr.syeyoung.dungeonsguide.dungeon.actions.tree; + +import kr.syeyoung.dungeonsguide.dungeon.actions.Action; +import lombok.Getter; + +import java.util.List; + +public class ActionRoute { + @Getter + private int current; + @Getter + private List<Action> actions; + + public ActionRoute(ActionTree tree) { + actions = ActionTreeUtil.linearifyActionTree(tree); + current = 0; + } + + public Action next() { + current ++; + if (current >= actions.size()) current = actions.size() - 1; + return actions.get(current); + } + + public Action prev() { + current --; + if (current < 0) current = 0; + return actions.get(current); + } + + public Action getCurrentAction() { + return actions.get(current); + } +} diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java index 701f9a4a..a6c1341b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonBreakableWall.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; @@ -94,4 +95,9 @@ public class DungeonBreakableWall implements DungeonMechanic, RouteBlocker { public Set<String> getPossibleStates(DungeonRoom dungeonRoom) { return isBlocking(dungeonRoom) ? Collections.singleton("open") : Collections.<String>emptySet(); } + + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("open", "closed"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java index 8026ccfe..25aedb7e 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDoor.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; @@ -94,4 +95,8 @@ public class DungeonDoor implements DungeonMechanic, RouteBlocker { return Collections.singleton("closed"); return Collections.emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("open", "closed"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java index 01b3323e..2d29be31 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonLever.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; @@ -88,4 +89,8 @@ public class DungeonLever implements DungeonMechanic { return Collections.singleton("untriggered"); return Collections.emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("triggered", "untriggered"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java index a1180f02..26c75997 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonMechanic.java @@ -15,4 +15,5 @@ public interface DungeonMechanic extends Serializable { String getCurrentState(DungeonRoom dungeonRoom); Set<String> getPossibleStates(DungeonRoom dungeonRoom); + Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom); } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java index 27f6fc68..3710b7f9 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayDoor.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPointSet; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; @@ -82,4 +83,8 @@ public class DungeonOnewayDoor implements DungeonMechanic, RouteBlocker { return Collections.singleton("open"); return Collections.emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("open", "closed"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java index a1500fa7..ae8f594b 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonOnewayLever.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionClick; @@ -86,4 +87,8 @@ public class DungeonOnewayLever implements DungeonMechanic { return Collections.singleton("triggered"); return Collections.emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("triggered", "untriggered"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java index ab33a5db..4eeeab35 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonPressurePlate.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionDropItem; @@ -90,4 +91,8 @@ public class DungeonPressurePlate implements DungeonMechanic { return Collections.singleton("triggered"); return Collections.emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("triggered", "untriggered"); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java index 91ede235..610ca94d 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java @@ -1,11 +1,14 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateBat; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; import kr.syeyoung.dungeonsguide.utils.RenderUtils; +import lombok.AllArgsConstructor; import lombok.Data; +import lombok.Getter; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntityChest; @@ -85,8 +88,12 @@ public class DungeonSecret implements DungeonMechanic { BAT, CHEST, ITEM_DROP } + @AllArgsConstructor + @Getter public static enum SecretStatus { - DEFINITELY_NOT, NOT_SURE, CREATED, FOUND, ERROR + DEFINITELY_NOT("definitely_not"), NOT_SURE("not_sure"), CREATED("created"), FOUND("found"), ERROR("error"); + + private String stateName; } public DungeonSecret clone() throws CloneNotSupportedException { @@ -100,7 +107,7 @@ public class DungeonSecret implements DungeonMechanic { @Override public String getCurrentState(DungeonRoom dungeonRoom) { - return getSecretStatus(dungeonRoom).name(); + return getSecretStatus(dungeonRoom).getStateName(); } @Override @@ -109,4 +116,8 @@ public class DungeonSecret implements DungeonMechanic { if (status == SecretStatus.FOUND) return Collections.emptySet(); else return Collections.singleton("found"); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("found"/*, "definitely_not", "not_sure", "created", "error"*/); + } } diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java index 86c6a818..9b5a84fa 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonTomb.java @@ -1,5 +1,6 @@ package kr.syeyoung.dungeonsguide.dungeon.mechanics; +import com.google.common.collect.Sets; import kr.syeyoung.dungeonsguide.dungeon.actions.Action; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionChangeState; import kr.syeyoung.dungeonsguide.dungeon.actions.ActionClickSet; @@ -93,4 +94,8 @@ public class DungeonTomb implements DungeonMechanic, RouteBlocker { public Set<String> getPossibleStates(DungeonRoom dungeonRoom) { return isBlocking(dungeonRoom) ? Collections.singleton("open") : Collections.<String>emptySet(); } + @Override + public Set<String> getTotalPossibleStates(DungeonRoom dungeonRoom) { + return Sets.newHashSet("open", "closed"); + } } |