From 92c8d9cec9fcc3a53ad95ff0212d77bf87becab7 Mon Sep 17 00:00:00 2001 From: syeyoung Date: Fri, 12 Feb 2021 01:43:20 +0900 Subject: pathfinder go brrrr --- .../dungeonsguide/dungeon/mechanics/DungeonDummy.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java') diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java index 6cd7238a..41e591c1 100755 --- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonDummy.java @@ -1,10 +1,7 @@ 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.ActionInteract; -import kr.syeyoung.dungeonsguide.dungeon.actions.ActionMove; +import kr.syeyoung.dungeonsguide.dungeon.actions.*; import kr.syeyoung.dungeonsguide.dungeon.data.OffsetPoint; import kr.syeyoung.dungeonsguide.dungeon.mechanics.predicates.PredicateArmorStand; import kr.syeyoung.dungeonsguide.dungeon.roomfinder.DungeonRoom; @@ -26,13 +23,17 @@ public class DungeonDummy implements DungeonMechanic { @Override public Set getAction(String state, DungeonRoom dungeonRoom) { - if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); +// if (!"navigate".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret"); Set base; Set preRequisites = base = new HashSet(); - { + if (state.equalsIgnoreCase("navigate")){ ActionMove actionMove = new ActionMove(secretPoint); preRequisites.add(actionMove); preRequisites = actionMove.getPreRequisite(); + } else if (state.equalsIgnoreCase("click")) { + ActionClick actionMove = new ActionClick(secretPoint); + preRequisites.add(actionMove); + preRequisites = actionMove.getPreRequisite(); } { for (String str : preRequisite) { @@ -68,11 +69,11 @@ public class DungeonDummy implements DungeonMechanic { @Override public Set getPossibleStates(DungeonRoom dungeonRoom) { - return Sets.newHashSet("navigate"); + return Sets.newHashSet("navigate", "click"); } @Override public Set getTotalPossibleStates(DungeonRoom dungeonRoom) { - return Sets.newHashSet("no-state","navigate"); + return Sets.newHashSet("no-state","navigate,click"); } @Override public OffsetPoint getRepresentingPoint() { -- cgit