Ejemplo n.º 1
0
 public static void CmdCompetition(String[] args, int num)
 {
     if (args.Length < 2)
     {
         throw new Exception("Wrong number of arguments. A competition requires at least two players.");
     }
     Player[] players = new Player[args.Length];
     for (int i = 0; i < args.Length; i++)
     {
         players[i] = PlayerList.GetPlayer(args[i]);
     }
     foreach (Player white in players)
     {
         foreach (Player black in players)
         {
             if (white != black)
             {
                 for (int n = 0; n < num; n++)
                 {
                     Scheduler.ScheduleMatch(new Match(white, black));
                 }
             }
         }
     }
 }
Ejemplo n.º 2
0
 public static void CmdMatch(String[] args, int num)
 {
     if (args.Length != 2)
     {
         throw new Exception("Wrong number of arguments. A match requires two players.");
     }
     for (int n = 0; n < num; n++)
     {
         Scheduler.ScheduleMatch(new Match(PlayerList.GetPlayer(args[0]), PlayerList.GetPlayer(args[1])));
     }
 }