コード例 #1
0
 /// <summary>
 /// rozegranie turnieju
 /// </summary>
 /// <param name="TeamList">lista druzyn do rozegrania turnieju</param>
 /// <param name="refs">sedziowie ktorzy beda sedziowali</param>
 public void PlayTournament(List <Team> TeamList, Referees refs)
 {
     if (isTournamentPlayed == false)
     {
         int          i    = 0;
         List <Team>  list = new List <Team>();
         List <Match> h    = new List <Match>();
         foreach (Team w in TeamList)
         {
             w.setLoses(0);
             w.setWins(0);
             list.Add(w);
         }
         while (list.Count > 0)
         {
             i = 0;
             Team team = list[0];
             list.RemoveAt(0);
             foreach (Team x in list)
             {
                 Match m = ChooseTournamentSport(list);
                 m.setTeam1(team);
                 m.ChooseReferee(refs);
                 m.setTeam2(list[i]);
                 m.Play();
                 MatchList.Add(m);
                 i++;
             }
         }
     }
     isTournamentPlayed = true;
 }
コード例 #2
0
        public override void ChooseReferee(Referees o)
        {
            List <Referee> p = o.getRefs();
            Random         x = new Random();
            int            l = x.Next(p.Count);

            r = p[l];
        }
コード例 #3
0
        public override void ChooseReferee(Referees r) //wybor sedziow do meczu
        {
            List <Referee> p = new List <Referee>();

            foreach (Referee reff in r.getRefs())
            {
                p.Add(reff);
            }
            Random x = new Random();
            int    l = x.Next(p.Count);

            RefTab[0] = p[l];
            p.RemoveAt(l);
            l         = x.Next(p.Count);
            RefTab[1] = p[l];
            p.RemoveAt(l);
            l         = x.Next(p.Count);
            RefTab[2] = p[l];
        }
コード例 #4
0
 public virtual void ChooseReferee(Referees r)
 {
 }