diff options
Diffstat (limited to 'src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight')
-rw-r--r-- | src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java index 652206c2..c529670e 100644 --- a/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java +++ b/src/main/java/kr/syeyoung/dungeonsguide/roomprocessor/bossfight/GeneralBossfightProcessor.java @@ -58,10 +58,10 @@ public abstract class GeneralBossfightProcessor implements BossfightProcessor { for (String nextPhase : currentPhase.getNextPhases()) { PhaseData phaseData = phases.get(nextPhase); if (phaseData == null) continue; - if (phaseData.signatureMsgs.contains(chat.getFormattedText())) { - currentPhase = phaseData; - onPhaseChange(); - return; + if (phaseData.signatureMsgs.contains(chat.getFormattedText().replace(" ", ""))) { + currentPhase = phaseData; + onPhaseChange(); + return; } } } @@ -115,10 +115,20 @@ public abstract class GeneralBossfightProcessor implements BossfightProcessor { @Data @Builder public static class PhaseData { + private PhaseData(String phase, Set<String> signatureMsgs, Set<String> nextPhase) { + this.phase = phase; + this.nextPhases = new HashSet<>(nextPhase); + this.signatureMsgs = new HashSet<>(); + for (String signatureMsg : signatureMsgs) { + this.signatureMsgs.add(signatureMsg.replace(" ", "")); + } + } + private String phase; @Singular private Set<String> signatureMsgs; @Singular private Set<String> nextPhases; + } } |