Package robocode.control.snapshot

Examples of robocode.control.snapshot.ITurnSnapshot


      robotPeer.startRound(waitMillis, waitNanos);
    }

    Logger.logMessage(""); // puts in a new-line in the log message

    final ITurnSnapshot snapshot = new TurnSnapshot(this, robots, bullets, false);

    eventDispatcher.onRoundStarted(new RoundStartedEvent(snapshot, getRoundNum()));
  }
View Full Code Here


  }

  // this is always dispatched on AWT thread
  private void awtOnTurnEnded(boolean forceRepaint, boolean readoutText) {
    try {
      ITurnSnapshot current = snapshot.get();

      if (current == null) { // !isRunning.get() ||
        // paint logo
        lastSnapshot = null;
        battleEventDispatcher.onTurnEnded(new TurnEndedEvent(null));
View Full Code Here

    paint(g);
  }

  @Override
  public void paint(Graphics g) {
    final ITurnSnapshot lastSnapshot = windowManager.getLastSnapshot();
    if (lastSnapshot != null) {
      update(lastSnapshot);
    } else {
      paintRobocodeLogo((Graphics2D) g);
    }
View Full Code Here

  @Override
  protected void initializeRound() {
    super.initializeRound();

    final ITurnSnapshot snapshot = recordManager.readSnapshot(currentTime);

    if (snapshot != null) {
      eventDispatcher.onRoundStarted(new RoundStartedEvent(snapshot, getRoundNum()));
    }
  }
View Full Code Here

    eventDispatcher.onTurnStarted(new TurnStartedEvent());
  }

  @Override
  protected void finalizeTurn() {
    final ITurnSnapshot snapshot = recordManager.readSnapshot(currentTime);

    if (snapshot != null) {
      final IRobotSnapshot[] robots = snapshot.getRobots();

      for (int i = 0; i < robots.length; i++) {
        RobotSnapshot robot = (RobotSnapshot) robots[i];

        robot.setPaintEnabled(paint[i]);
View Full Code Here

          oos = new ObjectOutputStream(bos);

          for (int i = 0; i < recordInfo.turnsInRounds.length; i++) {
            for (int j = recordInfo.turnsInRounds[i] - 1; j >= 0; j--) {
              try {
                ITurnSnapshot turn = (ITurnSnapshot) ois.readObject();

                oos.writeObject(turn);
              } catch (ClassNotFoundException e) {
                logError(e);
              }
View Full Code Here

      getPauseButton().setSelected(false);
    }

    @Override
    public void onTurnEnded(TurnEndedEvent event) {
      final ITurnSnapshot turn = event.getTurnSnapshot();

      if (turn == null) {
        return;
      }

      lastSnapshot = turn.getRobots()[robotIndex];
      final String text = lastSnapshot.getOutputStreamSnapshot();

      if (text != null && text.length() > 0) {
        getConsoleScrollPane().append(text);
        getConsoleScrollPane().scrollToBottom();
View Full Code Here

  protected AbstractTableModel getTableModel() {
    return tableModel;
  }

  private void update() {
    final ITurnSnapshot current = snapshot.get();

    if (lastSnapshot != current) {
      setResultsData();

      lastSnapshot = current;
View Full Code Here

  private class BattleObserver extends BattleAdaptor {

    @Override
    public void onTurnEnded(TurnEndedEvent event) {
      final ITurnSnapshot turn = event.getTurnSnapshot();

      if (turn == null) {
        return;
      }
      final IRobotSnapshot[] robots = turn.getRobots();
      final IScoreSnapshot[] scoreSnapshotList = event.getTurnSnapshot().getIndexedTeamScores();

      maxEnergy = 0;
      for (IRobotSnapshot robot : robots) {
        if (maxEnergy < robot.getEnergy()) {
View Full Code Here

    public void onTurnEnded(TurnEndedEvent event) {
      if (event == null) {
        return;
      }
      final ITurnSnapshot turn = event.getTurnSnapshot();

      if (turn == null) {
        return;
      }
View Full Code Here

TOP

Related Classes of robocode.control.snapshot.ITurnSnapshot

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.