public void playMultiPlayerMatch(MultiplayerRound round) { tableEventSource.fireTableEvent(EventType.START_MULTIPLAYER_MATCH, round, options.getMatchOptions()); }
public void playMatch(TournamentPairing pair) { options.getMatchOptions().getPlayerTypes().clear(); options.getMatchOptions().getPlayerTypes().add(pair.getPlayer1().getPlayerType()); options.getMatchOptions().getPlayerTypes().add(pair.getPlayer2().getPlayerType()); tableEventSource.fireTableEvent(EventType.START_MATCH, pair, options.getMatchOptions()); }
public TableController(UUID roomId, UUID userId, TournamentOptions options) { this.userId = userId; tournament = TournamentFactory.instance.createTournament(options.getTournamentType(), options); if (userId != null) { Optional<User> user = UserManager.instance.getUser(userId); if (!user.isPresent()) { logger.fatal(new StringBuilder("User for userId ").append(userId).append(" could not be retrieved from UserManager").toString()); controllerName = "[unknown]"; } else { controllerName = user.get().getName(); } } else { controllerName = "System"; } table = new Table(roomId, options.getTournamentType(), options.getName(), controllerName, DeckValidatorFactory.instance.createDeckValidator(options.getMatchOptions().getDeckType()), options.getPlayerTypes(), TableRecorderImpl.instance, tournament, options.getMatchOptions().getBannedUsers(), options.isPlaneChase()); chatId = ChatManager.instance.createChatSession("Tourn. table " + table.getId()); }
this.endTime = table.getTournament().getEndTime(); this.replayAvailable = false; this.rated = table.getTournament().getOptions().getMatchOptions().isRated();
if (options.getMatchOptions().isLimited()) { userRating = user.getUserData().getLimitedRating(); } else {
PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_TIME_LIMIT + versionStr, Integer.toString(tOptions.getMatchOptions().getPriorityTime())); if (this.spnConstructTime.isVisible()) { PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_CONSTR_TIME + versionStr, Integer.toString(tOptions.getLimitedOptions().getConstructionTime())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_FREE_MULLIGANS + versionStr, Integer.toString(tOptions.getMatchOptions().getFreeMulligans())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_NUMBER_OF_WINS + versionStr, Integer.toString(tOptions.getMatchOptions().getWinsNeeded())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_QUIT_RATIO + versionStr, Integer.toString(tOptions.getQuitRatio())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_MINIMUM_RATING + versionStr, Integer.toString(tOptions.getMinimumRating())); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_ALLOW_ROLLBACKS + versionStr, (tOptions.getMatchOptions().isRollbackTurnsAllowed() ? "Yes" : "No")); PreferencesDialog.saveValue(PreferencesDialog.KEY_NEW_TOURNAMENT_RATED + versionStr, (tOptions.getMatchOptions().isRated() ? "Yes" : "No"));
public TournamentView(Tournament tournament) { tournamentName = tournament.getOptions().getName(); StringBuilder typeText = new StringBuilder(tournament.getOptions().getTournamentType()); if (!tournament.getTournamentType().isLimited()) { typeText.append(" / ").append(tournament.getOptions().getMatchOptions().getDeckType()); } if (tournament.getNumberRounds() > 0) { typeText.append(' ').append(tournament.getNumberRounds()).append(" rounds"); } tournamentType = typeText.toString(); startTime = tournament.getStartTime(); endTime = tournament.getEndTime(); stepStartTime = tournament.getStepStartTime(); constructionTime = tournament.getOptions().getLimitedOptions().getConstructionTime(); watchingAllowed = tournament.getOptions().isWatchingAllowed(); serverTime = new Date(); tournamentState = tournament.getTournamentState(); if (tournament.getTournamentState().equals("Drafting") && tournament.getDraft() != null) { runningInfo = "booster/card: " + tournament.getDraft().getBoosterNum() + '/' + (tournament.getDraft().getCardNum() -1); } else { runningInfo = ""; } for (TournamentPlayer player: tournament.getPlayers()) { players.add(new TournamentPlayerView(player)); } Collections.sort(players); for (Round round: tournament.getRounds()) { rounds.add(new RoundView(round)); } }
tOptions.getMatchOptions().setDeckType("Limited"); tOptions.getMatchOptions().setGameType("Two Player Duel"); tOptions.getMatchOptions().setLimited(true); } else { tOptions.getLimitedOptions().setConstructionTime(0); tOptions.getLimitedOptions().setDraftCube(null); tOptions.getLimitedOptions().setDraftCubeName(""); tOptions.getMatchOptions().setDeckType((String) this.cbDeckType.getSelectedItem()); tOptions.getMatchOptions().setGameType(((GameTypeView) this.cbGameType.getSelectedItem()).getName()); tOptions.getMatchOptions().setLimited(false); tOptions.getMatchOptions().setBannedUsers(IgnoreList.ignoreList(serverAddress)); tOptions.getMatchOptions().setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem()); tOptions.getMatchOptions().setSkillLevel((SkillLevel) this.cbSkillLevel.getSelectedItem()); tOptions.getMatchOptions().setWinsNeeded((Integer) this.spnNumWins.getValue()); tOptions.getMatchOptions().setFreeMulligans((Integer) this.spnFreeMulligans.getValue()); tOptions.getMatchOptions().setAttackOption(MultiplayerAttackOption.LEFT); tOptions.getMatchOptions().setRange(RangeOfInfluence.ALL); tOptions.getMatchOptions().setRollbackTurnsAllowed(this.chkRollbackTurnsAllowed.isSelected()); tOptions.getMatchOptions().setRated(this.chkRated.isSelected()); saveTournamentSettingsToPrefs(tOptions);
if (table.getTournament().getOptions().getMatchOptions().isLimited()) { userRating = user.getUserData().getLimitedRating(); } else {
StringBuilder infoText = new StringBuilder(); StringBuilder stateText = new StringBuilder(table.getState().toString()); infoText.append("Wins:").append(table.getTournament().getOptions().getMatchOptions().getWinsNeeded()); infoText.append(" Seats: ").append(this.seatsInfo); switch (table.getState()) { case READY_TO_START: case STARTING: infoText.append(" Time: ").append(table.getTournament().getOptions().getMatchOptions().getMatchTimeLimit().toString()); if (table.getTournament().getOptions().getMatchOptions().getFreeMulligans() > 0) { infoText.append(" Fr.Mul: ").append(table.getTournament().getOptions().getMatchOptions().getFreeMulligans()); this.tableStateText = stateText.toString(); this.deckType = table.getDeckType() + ' ' + table.getTournament().getBoosterInfo(); this.skillLevel = table.getTournament().getOptions().getMatchOptions().getSkillLevel(); this.quitRatio = Integer.toString(table.getTournament().getOptions().getQuitRatio()); this.minimumRating = Integer.toString(table.getTournament().getOptions().getMinimumRating()); this.limited = table.getTournament().getOptions().getMatchOptions().isLimited(); this.rated = table.getTournament().getOptions().getMatchOptions().isRated(); this.passworded = !table.getTournament().getOptions().getPassword().isEmpty(); this.spectatorsAllowed = table.getTournament().getOptions().isWatchingAllowed();