From a14e3f8a52184a1972ad741a87406ed4f3ffe624 Mon Sep 17 00:00:00 2001 From: "jakub.salavec" Date: Tue, 4 Feb 2025 12:41:14 +0100 Subject: [PATCH] Tournament Recurring Queue now supports sealed tourneys --- .../tournament/ImmediateRecurringQueue.java | 53 ++++++++++++++----- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/ImmediateRecurringQueue.java b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/ImmediateRecurringQueue.java index 570804d91..ad892b60a 100644 --- a/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/ImmediateRecurringQueue.java +++ b/gemp-lotr/gemp-lotr-server/src/main/java/com/gempukku/lotro/tournament/ImmediateRecurringQueue.java @@ -31,19 +31,48 @@ public class ImmediateRecurringQueue extends AbstractTournamentQueue implements _playerDecks.remove(player); } - var params = new TournamentParams() {{ - this.tournamentId = tid; - this.name = tournamentName; - this.format = getFormatCode(); - this.startTime = DateUtils.Now().toLocalDateTime(); - this.type = Tournament.TournamentType.CONSTRUCTED; - this.playoff = Tournament.PairingType.SINGLE_ELIMINATION; - this.manualKickoff = false; - this.cost = getCost(); - this.minimumPlayers = _playerCap; - }}; + boolean isSealed = _tournamentInfo instanceof SealedTournamentInfo; + + TournamentParams params; + TournamentInfo newInfo; + + if (isSealed) { + params = new SealedTournamentParams() {{ + this.type = Tournament.TournamentType.SEALED; + + this.deckbuildingDuration = ((SealedTournamentParams) _tournamentInfo._params).deckbuildingDuration; + this.turnInDuration = ((SealedTournamentParams) _tournamentInfo._params).turnInDuration; + + this.sealedFormatCode = ((SealedTournamentParams) _tournamentInfo._params).sealedFormatCode; + this.format = _tournamentInfo._params.format; + this.requiresDeck = false; + + this.tournamentId = tid; + this.playoff = _tournamentInfo._params.playoff; + this.prizes = _tournamentInfo._params.prizes; + this.name = tournamentName; + this.format = getFormatCode(); + this.startTime = DateUtils.Now().toLocalDateTime(); + this.manualKickoff = false; + this.cost = getCost(); + this.minimumPlayers = _playerCap; + }}; + newInfo = new SealedTournamentInfo((SealedTournamentInfo) _tournamentInfo, (SealedTournamentParams) params); + } else { + params = new TournamentParams() {{ + this.tournamentId = tid; + this.name = tournamentName; + this.format = getFormatCode(); + this.startTime = DateUtils.Now().toLocalDateTime(); + this.type = Tournament.TournamentType.CONSTRUCTED; + this.playoff = Tournament.PairingType.SINGLE_ELIMINATION; + this.manualKickoff = false; + this.cost = getCost(); + this.minimumPlayers = _playerCap; + }}; + newInfo = new TournamentInfo(_tournamentInfo, params); + } - var newInfo = new TournamentInfo(_tournamentInfo, params); var tournament = _tournamentService.addTournament(newInfo); tournamentQueueCallback.createTournament(tournament);