示例#1
0
    // 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);
        }
    }
示例#2
0
        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;
        }
示例#3
0
 private void OnBattleCompleted(BattleCompletedEvent e)
 {
     if (BattleCompleted != null)
         BattleCompleted(e);
 }