Ejemplo n.º 1
0
  public boolean isRoundOver() {
    if (g_round_vote_count == 5) {
      int max = 0;
      String winner = "";
      for (Player p : this.g_players) {
        if (p.getVoteCount() > max) {
          winner = p.getUName();
          max = p.getVoteCount();
        }
      }
      if (max == 1) {
        this.g_round_winner = "roundTied";
      } else {
        for (Player p : this.g_players) {
          if ((p.getUName()).equals(winner)) {
            p.setRoundsWon(p.getRoundsWon() + 1);
          }
        }
        this.g_round_winner = winner;
      }
      return true;
    }

    return false;
  }