aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java
diff options
context:
space:
mode:
authorsyeyoung <cyong06@naver.com>2021-02-10 17:58:54 +0900
committersyeyoung <cyong06@naver.com>2021-02-10 17:58:54 +0900
commitb6a7d4231a245a4d0ba772761319bd180c44944d (patch)
treee253ed6275ef87426e3de5f9b5529e6bdeba7901 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java
parent2223e55d5d9c61f4ab93d8dab0b5f9820272c8fe (diff)
downloadSkyblock-Dungeons-Guide-b6a7d4231a245a4d0ba772761319bd180c44944d.tar.gz
Skyblock-Dungeons-Guide-b6a7d4231a245a4d0ba772761319bd180c44944d.tar.bz2
Skyblock-Dungeons-Guide-b6a7d4231a245a4d0ba772761319bd180c44944d.zip
lots of things
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java')
-rwxr-xr-xsrc/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java
index 37acd018..08246c2a 100755
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/actions/ActionChangeState.java
@@ -9,7 +9,7 @@ import java.util.HashSet;
import java.util.Set;
@Data
-public class ActionChangeState implements Action{
+public class ActionChangeState extends AbstractAction{
@EqualsAndHashCode.Exclude
private Set<Action> preRequisite2 = new HashSet<Action>();
@@ -34,4 +34,12 @@ public class ActionChangeState implements Action{
public String toString() {
return "ChangeState\n- target: "+mechanicName+"\n- state: "+state;
}
+
+ @Override
+ public boolean isComplete(DungeonRoom dungeonRoom) {
+ DungeonMechanic mechanic = dungeonRoom.getDungeonRoomInfo().getMechanics().get(mechanicName);
+ if (mechanic== null)
+ return false;
+ return mechanic.getCurrentState(dungeonRoom).equalsIgnoreCase(state);
+ }
}