コード例 #1
0
ファイル: ArchonPlayer.java プロジェクト: ajpalkovic/b2010
  public void step() {
    spawning.changeModeToAttacking();

    if (moveTurns > 0) {
      if (navigation.simpleMove(Direction.SOUTH_EAST) == Status.success) moveTurns--;
    }

    // try to spawn a new dude every turn
    if (turnsSinceLastSpawn > 2) {
      int status = spawning.spawnRobot();
      if (status == Status.success) {
        turnsSinceLastSpawn = -1;
        try {
          messaging.sendFollowRequest(
              controller.getLocation(),
              controller.senseGroundRobotAtLocation(spawning.spawnLocation).getID());
        } catch (Exception e) {
          pa("----Exception Caught in sendFollowRequest()");
        }
      }
    }
    turnsSinceLastSpawn++;
    if (archonNumber == 1) messaging.sendMessageForEnemyRobots();
  }