From 67fa1076de0e29d7107fed4cfdcc099f3308fedd Mon Sep 17 00:00:00 2001 From: alterwain Date: Sat, 12 Apr 2025 04:32:09 +0300 Subject: [PATCH] Changed action cards logic. x5 --- .../java/com/alterdekim/javabot/components/BunkerBot.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/alterdekim/javabot/components/BunkerBot.java b/src/main/java/com/alterdekim/javabot/components/BunkerBot.java index 2f33611..1eec95b 100644 --- a/src/main/java/com/alterdekim/javabot/components/BunkerBot.java +++ b/src/main/java/com/alterdekim/javabot/components/BunkerBot.java @@ -84,7 +84,7 @@ public class BunkerBot extends TelegramLongPollingBot { this.textDataValService = textDataValService; this.disasterService = disasterService; this.synergyService = synergyService; - this.actionCards = List.of(RandomHIVCard.class, ChangeWorksCard.class); + this.actionCards = new ArrayList<>(List.of(RandomHIVCard.class, ChangeWorksCard.class)); this.random = randomComponent; this.dayNightFields = new DayNightFields(); this.linkedQueue = new ConcurrentLinkedQueue<>(); @@ -203,9 +203,9 @@ public class BunkerBot extends TelegramLongPollingBot { if( (random.nextInt(100) >= 45 || (i == (players.size()-1) && isNoOneHasScripts())) && !this.actionCards.isEmpty() ) { Class asc = (Class) BotUtils.getRandomFromList(this.actionCards, random); this.actionCards.removeIf(p -> p.getCanonicalName().equals(asc.getCanonicalName())); - players.get(i).setScripts(Collections.singletonList(asc)); + players.get(i).setScripts(new ArrayList<>(Collections.singletonList(asc))); } else { - players.get(i).setScripts(Collections.emptyList()); + players.get(i).setScripts(new ArrayList<>()); } } doNight();