@@ -43,6 +43,7 @@ public final class EventManager implements IEventManager {
4343 private Event currentTopEvent ;
4444 private int currentTopEventPriority ;
4545 private ScannedRobotEvent dummyScannedRobotEvent ;
46+ private ScannedShipEvent dummyScannedShipEvent ;
4647 private Map <String , Event > eventNames ;
4748
4849 private IBasicRobot robot ;
@@ -256,6 +257,21 @@ public List<ScannedRobotEvent> getScannedRobotEvents() {
256257 }
257258 return events ;
258259 }
260+
261+ /**
262+ * Returns a list containing all ScannedRobotEvents currently in the robot's queue.
263+ */
264+ public List <ScannedShipEvent > getScannedRobotEvents2 () {
265+ List <ScannedShipEvent > events = new ArrayList <ScannedShipEvent >();
266+ synchronized (eventQueue ) {
267+ for (Event e : eventQueue ) {
268+ if (e instanceof ScannedShipEvent ) {
269+ events .add ((ScannedShipEvent ) e );
270+ }
271+ }
272+ }
273+ return events ;
274+ }
259275
260276 /**
261277 * Returns a list containing all MessageEvents currently in the robot's queue.
@@ -324,6 +340,13 @@ public void setRobot(IBasicRobot robot) {
324340 public int getScannedRobotEventPriority () {
325341 return dummyScannedRobotEvent .getPriority ();
326342 }
343+
344+ /**
345+ * Returns the priority of a ScannedShipEvent.
346+ */
347+ public int getScannedShipEventPriority () {
348+ return dummyScannedShipEvent .getPriority ();
349+ }
327350
328351 /**
329352 * Returns the current time/turn of the battle round.
@@ -512,6 +535,7 @@ public void setEventPriority(String eventClass, int priority) {
512535 private void registerEventNames () {
513536 eventNames = new HashMap <String , Event >();
514537 dummyScannedRobotEvent = new ScannedRobotEvent (null , 0 , 0 , 0 , 0 , 0 , false );
538+ dummyScannedShipEvent = new ScannedShipEvent (null , 0 , 0 , 0 , 0 , 0 , 0 , 0 );
515539 registerEventNames (new BattleEndedEvent (false , null ));
516540 registerEventNames (new BulletHitBulletEvent (null , null ));
517541 registerEventNames (new BulletHitEvent (null , 0 , null ));
@@ -536,9 +560,15 @@ private void registerEventNames() {
536560 registerEventNames (new RobotDeathEvent (null ));
537561 registerEventNames (new RoundEndedEvent (0 , 0 , 0 ));
538562 registerEventNames (dummyScannedRobotEvent );
563+ registerEventNames (dummyScannedShipEvent );
539564 registerEventNames (new SkippedTurnEvent (0 ));
540565 registerEventNames (new StatusEvent (null ));
541566 registerEventNames (new WinEvent ());
567+
568+ //Mines
569+ registerEventNames (new MineHitMineEvent (null , null ));
570+ registerEventNames (new MineHitEvent ("" , 0 , null ));
571+ registerEventNames (new HitByMineEvent (null ));
542572
543573 // same as any line above but for custom event
544574 final DummyCustomEvent customEvent = new DummyCustomEvent ();
0 commit comments