예제 #1
0
  private void announceRound() {
    Round tr = rounds.get(round);

    String strround =
        preliminary_round && round == 0 ? "PreliminaryRound" : ("Round " + (round + 1));
    if (round + 1 == nrounds) {
      strround = "Final Round";
    }
    if (preliminary_round) {
      preliminary_round = false;
      int nprelims = tr.getMatchups().size() * eventParams.getMinTeams();
      for (int i = 0; i < aliveTeams.size() - nprelims; i++) {
        Team t = aliveTeams.get(i);
        t.sendMessage("&4[" + strround + "]&e You have a &5bye&e this round");
      }
    }
    BTInterface bti = new BTInterface(eventParams);
    final String prefix = eventParams.getPrefix();
    if (tr.getMatchups().size() <= 8) {
      for (Matchup m : tr.getMatchups()) {
        List<String> names = new ArrayList<String>();
        for (Team t : m.getTeams()) {
          names.add("&8" + t.getDisplayName() + "&6[" + bti.getElo(t) + "]");
        }
        String msg = "&e" + strround + ": " + StringUtils.join(names, " vs ");
        if (ChatPaginator.GUARANTEED_NO_WRAP_CHAT_PAGE_WIDTH > msg.length() + prefix.length()) {
          broadcastAlive(prefix + " " + msg);
        } else {
          broadcastAlive(msg);
        }
      }
    } else {
      broadcastAlive(
          prefix
              + "&e Round "
              + strround
              + " has "
              + tr.getMatchups().size()
              + " "
              + MessageUtil.teamsOrPlayers(eventParams.getMinTeamSize())
              + " competing. &6/tourney status:&e for updates");
    }
    if (round != nrounds)
      broadcast(
          prefix + "&e " + strround + " will start in &4" + timeBetweenRounds + " &eseconds!");
    else
      broadcast(
          prefix + "&e The " + strround + " will start in &4" + timeBetweenRounds + " &eseconds!");
  }
예제 #2
0
  private void announceRound() {
    Round tr = rounds.get(round);
    String strround = "Round " + (round + 1);
    if (round + 1 == nrounds) {
      strround = "Final Round";
    }
    if (preliminary_round) {
      preliminary_round = false;
      int nprelims = tr.getMatchups().size() * 2;
      for (int i = 0; i < aliveTeams.size() - nprelims; i++) {
        Team t = aliveTeams.get(i);
        t.sendMessage("&4[" + strround + "]&e You have a &5bye&e this round");
      }
    }
    BTInterface bti = new BTInterface(eventParams);
    final String prefix = eventParams.getPrefix();
    for (Matchup m : tr.getMatchups()) {
      if (m.getTeams().size() == 2) {
        Team t1 = m.getTeam(0);
        Team t2 = m.getTeam(1);

        Double elo1 = (double) bti.getElo(t1);
        Double elo2 = (double) bti.getElo(t2);
        //				System.out.println("team1 stat= " + bti.loadRecord(t1.getPlayers()));
        broadcast(
            prefix
                + "&e "
                + strround
                + ": &8"
                + t1.getDisplayName()
                + "&6["
                + elo1
                + "]"
                + "&e vs &8"
                + t2.getDisplayName()
                + "&6["
                + elo2
                + "]");
      }
    }
    if (round != nrounds)
      broadcast(
          prefix + "&e " + strround + " will start in &4" + timeBetweenRounds + " &eseconds!");
    else
      broadcast(
          prefix + "&e The " + strround + " will start in &4" + timeBetweenRounds + " &eseconds!");
  }