Tournament Recurring Queue now supports sealed tourneys
This commit is contained in:
@@ -31,19 +31,48 @@ public class ImmediateRecurringQueue extends AbstractTournamentQueue implements
|
|||||||
_playerDecks.remove(player);
|
_playerDecks.remove(player);
|
||||||
}
|
}
|
||||||
|
|
||||||
var params = new TournamentParams() {{
|
boolean isSealed = _tournamentInfo instanceof SealedTournamentInfo;
|
||||||
this.tournamentId = tid;
|
|
||||||
this.name = tournamentName;
|
TournamentParams params;
|
||||||
this.format = getFormatCode();
|
TournamentInfo newInfo;
|
||||||
this.startTime = DateUtils.Now().toLocalDateTime();
|
|
||||||
this.type = Tournament.TournamentType.CONSTRUCTED;
|
if (isSealed) {
|
||||||
this.playoff = Tournament.PairingType.SINGLE_ELIMINATION;
|
params = new SealedTournamentParams() {{
|
||||||
this.manualKickoff = false;
|
this.type = Tournament.TournamentType.SEALED;
|
||||||
this.cost = getCost();
|
|
||||||
this.minimumPlayers = _playerCap;
|
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);
|
var tournament = _tournamentService.addTournament(newInfo);
|
||||||
tournamentQueueCallback.createTournament(tournament);
|
tournamentQueueCallback.createTournament(tournament);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user