aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java
diff options
context:
space:
mode:
authorsyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-14 18:31:24 +0900
committersyeyoung <42869671+cyoung06@users.noreply.github.com>2020-12-14 18:31:24 +0900
commit299a569e6e37870bf7828500244916acefc3e1a0 (patch)
tree238597b930190b441382e73c4df0926fc757a799 /src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java
parent54b2804d7ff5c1d560893376070979d993ef0580 (diff)
downloadSkyblock-Dungeons-Guide-299a569e6e37870bf7828500244916acefc3e1a0.tar.gz
Skyblock-Dungeons-Guide-299a569e6e37870bf7828500244916acefc3e1a0.tar.bz2
Skyblock-Dungeons-Guide-299a569e6e37870bf7828500244916acefc3e1a0.zip
oneway and two way
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java')
-rw-r--r--src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java13
1 files changed, 9 insertions, 4 deletions
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 90adb774..fe5ad8c7 100644
--- a/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java
+++ b/src/main/java/kr/syeyoung/dungeonsguide/dungeon/mechanics/DungeonSecret.java
@@ -18,10 +18,8 @@ import net.minecraft.util.BlockPos;
import org.jetbrains.annotations.Nullable;
import java.awt.*;
-import java.util.ArrayList;
-import java.util.HashSet;
+import java.util.*;
import java.util.List;
-import java.util.Set;
@Data
public class DungeonSecret implements DungeonMechanic {
@@ -52,7 +50,7 @@ public class DungeonSecret implements DungeonMechanic {
@Override
public Set<Action> getAction(String state, DungeonRoom dungeonRoom) {
- if (!"claimed".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret");
+ if (!"found".equalsIgnoreCase(state)) throw new IllegalArgumentException(state+" is not valid state for secret");
Set<Action> base;
Set<Action> preRequisites = base = new HashSet<Action>();
if (secretType == SecretType.CHEST) {
@@ -109,4 +107,11 @@ public class DungeonSecret implements DungeonMechanic {
public String getCurrentState(DungeonRoom dungeonRoom) {
return getSecretStatus(dungeonRoom).name();
}
+
+ @Override
+ public Set<String> getPossibleStates(DungeonRoom dungeonRoom) {
+ SecretStatus status = getSecretStatus(dungeonRoom);
+ if (status == SecretStatus.FOUND) return Collections.emptySet();
+ else return Collections.singleton("found");
+ }
}