Exemplo n.º 1
0
  /** Function for counting the sum of the scores gathered by the robots. */
  private void countTotalScores() {
    currentSum = 0;
    totalSum = 0;

    for (IScoreSnapshot score : scoreSnapshotList) {
      currentSum += score.getCurrentScore();
      totalSum += score.getTotalScore();
    }
  }
Exemplo n.º 2
0
  public Object getValueAt(int row, int col) {

    final IScoreSnapshot statistics = scoreSnapshotList[row];

    switch (col) {
      case 0:
        return getPlacementString(row + 1);

      case 1:
        return statistics.getName();

      case 2:
        {
          final double current = statistics.getCurrentScore();
          final double total = statistics.getTotalScore();

          return (int) (current + 0.5)
              + " / "
              + (int) (total + current + 0.5)
              + "  ("
              + (int) (current / currentSum * 100)
              + " / "
              + (int) ((total + current) / (totalSum + currentSum) * 100)
              + "%)";
        }

      case 3:
        {
          final double current = statistics.getCurrentSurvivalScore();
          final double total = statistics.getTotalSurvivalScore();

          return (int) (current + 0.5) + " / " + (int) (total + current + 0.5);
        }

      case 4:
        return (int) (statistics.getTotalLastSurvivorBonus() + 0.5);

      case 5:
        {
          final double current = statistics.getCurrentBulletDamageScore();
          final double total = statistics.getTotalBulletDamageScore();

          return (int) (current + 0.5) + " / " + (int) (total + current + 0.5);
        }

      case 6:
        {
          final double current = statistics.getCurrentBulletKillBonus();
          final double total = statistics.getTotalBulletKillBonus();

          return (int) (current + 0.5) + " / " + (int) (total + current + 0.5);
        }

      case 7:
        {
          final double current = statistics.getCurrentRammingDamageScore();
          final double total = statistics.getTotalRammingDamageScore();

          return (int) (current + 0.5) + " / " + (int) (total + current + 0.5);
        }

      case 8:
        {
          final double current = statistics.getCurrentRammingKillBonus();
          final double total = statistics.getTotalRammingKillBonus();

          return (int) (current + 0.5) + " / " + (int) (total + current + 0.5);
        }

      case 9:
        return "" + statistics.getTotalFirsts();

      case 10:
        return "" + statistics.getTotalSeconds();

      case 11:
        return "" + statistics.getTotalThirds();

      default:
        return "";
    }
  }