// Called when the battle is completed successfully with battle results private static void BattleCompleted(BattleCompletedEvent e) { Console.WriteLine("-- Battle has completed --"); // Print out the sorted results with the robot names Console.WriteLine("Battle results:"); foreach (BattleResults result in e.SortedResults) { Console.WriteLine(" " + result.TeamLeaderName + ": " + result.Score); } }
private static BattleCompletedEvent[] MapEvents(robocode.control.events.BattleCompletedEvent[] events) { if (events == null) { return null; } BattleCompletedEvent[] mappedEvents = new BattleCompletedEvent[events.Length]; for (int i = 0; i < events.Length; i++) { mappedEvents[i] = MapEvent(events[i]); } return mappedEvents; }
private void OnBattleCompleted(BattleCompletedEvent e) { if (BattleCompleted != null) BattleCompleted(e); }