}
// 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);
}
}
}