Package robocode.control

Examples of robocode.control.RobotSpecification


      countedNames.put(name, order - 1);
    }

    // name robots
    for (int i = battlingRobotsList.length - 1; i >= 0; i--) {
      RobotSpecification specification = battlingRobotsList[i];
      String name = ((IRobotItem) HiddenAccess.getFileSpecification(specification)).getUniqueFullClassNameWithVersion();
      Integer order = countedNames.get(name);
      int duplicate = -1;

      String newName = name;

      if (order > 1) {
        duplicate = (order - 2);
        newName = name + " (" + (order - 1) + ")";
      }
      countedNames.put(name, (order - 1));
      robotDuplicates.add(0, duplicate);

      String teamFullName = HiddenAccess.getRobotTeamName(specification);

      if (teamFullName != null) {
        List<String> members = teamMembers.get(teamFullName);

        members.add(newName);
      }
    }

    // create teams
    Map<String, TeamPeer> namedTeams = new HashMap<String, TeamPeer>();

    // create robots
    for (int i = 0; i < battlingRobotsList.length; i++) {
      RobotSpecification specification = battlingRobotsList[i];
      TeamPeer team = null;

      String teamFullName = HiddenAccess.getRobotTeamName(specification);

      // The team index and robot index depends on current sizes of the contestant list and robot list
View Full Code Here


    for (int rank = 0; rank < contestants.size(); rank++) {
      ContestantPeer contestant = contestants.get(rank);
      contestant.getStatistics().setRank(rank + 1);
      BattleResults battleResults = contestant.getStatistics().getFinalResults();

      RobotSpecification robotSpec = null;
      if (contestant instanceof RobotPeer) {
        robotSpec = ((RobotPeer) contestant).getRobotSpecification();
      } else if (contestant instanceof TeamPeer) {
        robotSpec = ((TeamPeer) contestant).getTeamLeader().getRobotSpecification();
      }
View Full Code Here

   *
   * @param robots The robots to set
   */
  public void setSelectedRobots(RobotSpecification[] robots) {
    StringBuffer robotString = new StringBuffer();
    RobotSpecification robot;

    for (int i = 0; i < robots.length; i++) {
      robot = robots[i];
      if (robot == null) {
        continue;
      }

      robotString.append(robot.getClassName());

      if (!(robot.getVersion() == null || robot.getVersion().length() == 0)) {
        robotString.append(' ').append(robot.getVersion());
      }

      if (i < robots.length - 1) {
        robotString.append(',');
      }
View Full Code Here

    }
    return path;
  }

  public RobotSpecification createRobotSpecification(RobotSpecification battleRobotSpec, String teamId) {
    RobotSpecification specification;

    if (battleRobotSpec != null) {
      specification = battleRobotSpec;
    } else {
      specification = createRobotSpecification();
View Full Code Here

TOP

Related Classes of robocode.control.RobotSpecification

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.