Package net.sf.robocode.host.events

Examples of net.sf.robocode.host.events.EventQueue


    }
    newCommands.setMaxVelocity(Math.min(abs(newCommands.getMaxVelocity()), Rules.MAX_VELOCITY));
  }

  private List<Event> readoutEvents() {
    return events.getAndSet(new EventQueue());
  }
View Full Code Here


  }

  // TODO: Only add events to robots that are alive? + Remove checks if the Robot is alive before adding the event?
  public void addEvent(Event event) {
    if (isRunning()) {
      final EventQueue queue = events.get();

      if ((queue.size() > EventManager.MAX_QUEUE_SIZE)
          && !(event instanceof DeathEvent || event instanceof WinEvent || event instanceof SkippedTurnEvent)) {
        println(
            "Not adding to " + statics.getShortName() + "'s queue, exceeded " + EventManager.MAX_QUEUE_SIZE
            + " events in queue.");
        // clean up old stuff
        queue.clear(battle.getTime() - EventManager.MAX_EVENT_STACK);
      } else {
        queue.add(event);
      }
    }
  }
View Full Code Here

TOP

Related Classes of net.sf.robocode.host.events.EventQueue

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.