Package net.sf.robocode.battle.peer

Examples of net.sf.robocode.battle.peer.RobotPeer


            teamIndex = team.getTeamIndex();
          }
        }
      }
      Integer duplicate = robotDuplicates.get(i);
      RobotPeer robotPeer = new RobotPeer(this, hostManager, specification, duplicate, team, robotIndex);

      robots.add(robotPeer);
      if (team == null) {
        contestants.add(robotPeer);
      }
View Full Code Here


        List<RobotPeer> orderedRobots = new ArrayList<RobotPeer>(robots);
        Collections.sort(orderedRobots);
        Collections.reverse(orderedRobots);

        for (int rank = 0; rank < robots.size(); rank++) {
          RobotPeer robotPeer = orderedRobots.get(rank);
          robotPeer.getStatistics().setRank(rank + 1);
          BattleResults battleResults = robotPeer.getStatistics().getFinalResults();
          robotPeer.addEvent(new BattleEndedEvent(isAborted(), battleResults));
        }
      }
    }

    if (endTimer > 4 * TURNS_DISPLAYED_AFTER_ENDING) {
      for (RobotPeer robotPeer : robots) {
        robotPeer.setHalt(true);
      }
    }

    super.shutdownTurn();
  }
View Full Code Here

  private int getActiveContestantCount(RobotPeer peer) {
    int count = 0;

    for (ContestantPeer c : contestants) {
      if (c instanceof RobotPeer) {
        RobotPeer robot = (RobotPeer) c;
        if (!robot.isSentryRobot() && robot.isAlive()) {
          count++;
        }
      } else if (c instanceof TeamPeer && c != peer.getTeamPeer()) {
        for (RobotPeer robot: (TeamPeer) c) {
          if (!robot.isSentryRobot() && robot.isAlive()) {
            count++;
            break;
          }
        }
      }
View Full Code Here

    isExplosion = (bullet instanceof ExplosionPeer);
    explosionImageIndex = bullet.getExplosionImageIndex();

    bulletId = bullet.getBulletId();

    final RobotPeer victim = bullet.getVictim();

    if (victim != null) {
      victimIndex = victim.getRobotIndex();
    }

    ownerIndex = bullet.getOwner().getRobotIndex();

    heading = bullet.getHeading();
View Full Code Here

TOP

Related Classes of net.sf.robocode.battle.peer.RobotPeer

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.