Exemplo n.º 1
0
  /**
   * Score
   *
   * @param team Team
   * @param nInc Score increment
   */
  public void score(Team team, int nInc) {
    Team tempTeam;
    ListIterator teamsList = teams.listIterator(0);
    while (teamsList.hasNext()) {
      tempTeam = (Team) teamsList.next();

      if (tempTeam.compare(team)) {
        /* score!! */
        Log.debug("score!!");
        team.addScore(nInc);
      }
    }
  }
Exemplo n.º 2
0
  /**
   * Set ScoreBoard (XXX: another misleading class name)
   *
   * @param board Score board
   */
  public void setScoreBoard(scoreBoard board) {

    ListIterator teamsList = teams.listIterator(0);
    Team tempTeam;
    float finalScore;
    int tempScore;

    while (teamsList.hasNext()) {
      tempTeam = (Team) teamsList.next();
      tempScore = tempTeam.getScore();
      finalScore = (float) tempScore / maxScore;
      board.Insert(tempTeam.teamName, tempTeam.rgbColor, finalScore);
    }
  }