private void eliminatePlayers(Round round) { for (TournamentPairing pair: round.getPairs()) { pair.eliminatePlayers(); } }
private boolean alreadyPaired(List<Round> rounds, TournamentPlayer player1, TournamentPlayer player2) { for (Round round : rounds) { for (TournamentPairing pairing : round.getPairs()) { if (pairing.getPlayer1().equals(player1) || pairing.getPlayer2().equals(player1)) { if (pairing.getPlayer1().equals(player2) || pairing.getPlayer2().equals(player2)) { return true; } } } } return false; } }
protected void playRound(Round round) { for (TournamentPairing pair : round.getPairs()) { playMatch(pair); } updateResults(); // show points from byes while (!round.isRoundOver()) { try { //TODO: improve this Thread.sleep(1000); } catch (InterruptedException ex) { Logger.getLogger(TournamentImpl.class).warn("TournamentImpl playRound error ", ex); break; } } updateResults(); }
for (TournamentPairing pairing : round.getPairs()) { TournamentPlayer player1 = pairing.getPlayer1(); TournamentPlayer player2 = pairing.getPlayer2(); int[] byes = new int[playersCount]; for (Round round : rounds) { for (TournamentPairing pairing : round.getPairs()) { TournamentPlayer player1 = pairing.getPlayer1(); TournamentPlayer player2 = pairing.getPlayer2();
public RoundView(Round round) { try { for (TournamentPairing pair : round.getPairs()) { // get info of finished games from match if (pair.getMatch() != null) { for (GameInfo gameInfo : pair.getMatch().getGamesInfo()) { games.add(new TournamentGameView(round.getRoundNumber(), gameInfo.getMatchId(), gameInfo.getGameId(), gameInfo.getState(), gameInfo.getResult(), gameInfo.getPlayers(), gameInfo.getTableId())); } if (!pair.getMatch().hasEnded()) { int numberSavedGames = pair.getMatch().getGamesInfo().size(); if (pair.getMatch() != null) { int gameCount = 0; for (Game game : pair.getMatch().getGames()) { gameCount++; if (gameCount > numberSavedGames) { // only unfinished game info directly from game games.add(new TournamentGameView(round.getRoundNumber(), pair, game)); } } } } } } } catch (Exception ex) { ex.printStackTrace(); } }
for (TournamentPairing pair : round.getPairs()) { Match match = pair.getMatch(); if (match != null && match.hasEnded()) {
TourneyRoundProto.Builder roundBuilder = tourneyBuilder.addRoundsBuilder() .setRound(round.getRoundNumber()); for (TournamentPairing pair : round.getPairs()) { Match match = pair.getMatch(); if (match != null && match.hasEnded()) {