Package robocode

Examples of robocode.BattleResults


    resetScores();
    isActive = false;
  }

  public BattleResults getFinalResults() {
    return new BattleResults(robotPeer.getTeamName(), rank, totalScore, totalSurvivalScore, totalLastSurvivorBonus,
        totalBulletDamageScore, totalBulletKillBonus, totalRammingDamageScore, totalRammingKillBonus, totalFirsts,
        totalSeconds, totalThirds);
  }
View Full Code Here


    }
    return d;
  }

  public BattleResults getFinalResults() {
    return new BattleResults(teamPeer.getName(), rank, getTotalScore(), getTotalSurvivalScore(),
        getTotalLastSurvivorBonus(), getTotalBulletDamageScore(), getTotalBulletKillBonus(),
        getTotalRammingDamageScore(), getTotalRammingKillBonus(), getTotalFirsts(), getTotalSeconds(),
        getTotalThirds());
  }
View Full Code Here

    return title;
  }

  public Object getValueAt(int row, int col) {

    BattleResults statistics = results[row];

    switch (col) {
    case 0: {
      int place = row + 1;

      while (place < getRowCount() && statistics.getScore() == results[place].getScore()) {
        place++;
      }
      return getPlacementString(place);
    }

    case 1:
      return statistics.getTeamLeaderName();

    case 2:
      String percent = "";

      if (totalScore != 0) {
        percent = " (" + NumberFormat.getPercentInstance().format(statistics.getScore() / totalScore) + ")";
      }
      return "" + (int) (statistics.getScore() + 0.5) + percent;

    case 3:
      return "" + (int) (statistics.getSurvival() + 0.5);

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

    case 5:
      return "" + (int) (statistics.getBulletDamage() + 0.5);

    case 6:
      return "" + (int) (statistics.getBulletDamageBonus() + 0.5);

    case 7:
      return "" + (int) (statistics.getRamDamage() + 0.5);

    case 8:
      return "" + (int) (statistics.getRamDamageBonus() + 0.5);

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

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

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

    default:
      return "";
    }
  }
View Full Code Here

TOP

Related Classes of robocode.BattleResults

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.