Package robocode.control.snapshot

Examples of robocode.control.snapshot.IRobotSnapshot


    }
  }
 
  private void resetStartPositions(ITurnSnapshot turnSnapshot) {
    for (int i = 0; i < 3; i++) {
      IRobotSnapshot robot = turnSnapshot.getRobots()[i];

      startX[i] = robot.getX();
      startY[i] = robot.getY();
    }
  }
View Full Code Here


  @Override
  public void onTurnEnded(TurnEndedEvent event) {
    super.onTurnEnded(event);

    Assert.assertTrue(event.getTurnSnapshot().getTurn() <= 1407);
    IRobotSnapshot fire = event.getTurnSnapshot().getRobots()[0];
    IRobotSnapshot random = event.getTurnSnapshot().getRobots()[1];

    if (event.getTurnSnapshot().getTurn() == 1241) {
      Assert.assertNear(213.18621928, fire.getX());
      Assert.assertNear(371.45706118, fire.getY());
      Assert.assertNear(782.0, random.getX());
      Assert.assertNear(230.95479253, random.getY());
    }
  }
View Full Code Here

        }
        if (maxEnergy == 0) {
          maxEnergy = 1;
        }
        for (int index = 0; index < robots.size(); index++) {
          final IRobotSnapshot robot = robots.get(index);
          final boolean attach = index < RobotDialogManager.MAX_PRE_ATTACHED;
          final RobotButton button = net.sf.robocode.core.Container.createComponent(RobotButton.class);

          button.setup(robot.getName(), maxEnergy, index, robot.getContestantIndex(), attach);
          button.setText(robot.getShortName());
          addRobotButton(button);
        }
        getRobotButtonsPanel().repaint();
      }
    }
View Full Code Here

    return "tested.robots.WatchBullets,sample.SittingDuck";
  }

  public void onTurnEnded(TurnEndedEvent event) {
    super.onTurnEnded(event);
    final IRobotSnapshot robot = event.getTurnSnapshot().getRobots()[0];

    final String out = robot.getOutputStreamSnapshot();
    final int time = event.getTurnSnapshot().getTurn();

    test(out, time, 33, "33 487.438779505497 119.51131582855926 347.66745091446046 true");
    test(out, time, 45, "45 459.24550664858225 248.46533618316306 347.66745091446046 true");
    test(out, time, 52, "52 442.799430815382 323.6885147233484 347.66745091446046 true");
View Full Code Here

  @Override
  public void onRoundStarted(final RoundStartedEvent event) {
    super.onRoundStarted(event);
    if (event.getRound() == 0) {
      IRobotSnapshot crazy = event.getStartSnapshot().getRobots()[0];
      IRobotSnapshot target = event.getStartSnapshot().getRobots()[1];

      Assert.assertNear(568.1445492, crazy.getX());
      Assert.assertNear(163.0032275, crazy.getY());
      Assert.assertNear(436.7181397, target.getX());
      Assert.assertNear(351.5039067, target.getY());
    }
  }
View Full Code Here

  @Override
  public void onTurnEnded(TurnEndedEvent event) {
    super.onTurnEnded(event);
    lastTurn = event.getTurnSnapshot().getTurn();

    IRobotSnapshot crazy = event.getTurnSnapshot().getRobots()[0];
    IRobotSnapshot target = event.getTurnSnapshot().getRobots()[1];

    if (lastTurn == 1) {
      Assert.assertNear(567.2831835, crazy.getX());
      Assert.assertNear(162.4952421, crazy.getY());
      Assert.assertNear(436.7181397, target.getX());
      Assert.assertNear(351.5039067, target.getY());
    }

    if (lastTurn == 1700) {
      Assert.assertNear(373.9958377, crazy.getX());
      Assert.assertNear(196.1380677, crazy.getY());
      Assert.assertNear(340.3212984, target.getX());
      Assert.assertNear(456.5502002, target.getY());
    }
  }
View Full Code Here

TOP

Related Classes of robocode.control.snapshot.IRobotSnapshot

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.