Example #1
0
        public override void Initialise()
        {
            if (!Tournament.IsInternational())
            {
                AddTeamsToRecover();
            }
            //If it's an international tournament (national teams or continental cup eg), we add all teams to recover for all rounds now because ranking can fluctuate after and the same team could be selected for 2 differents rounds
            else if (Tournament.rounds[0] == this)
            {
                foreach (Round r in Tournament.rounds)
                {
                    r.AddTeamsToRecover();
                }
            }

            if (_noRandomDrawing)
            {
                Round previousRound = Tournament.rounds[Tournament.rounds.IndexOf(this) - 1];
                if (previousRound as KnockoutRound != null)
                {
                    KnockoutRound previousRoundKO = previousRound as KnockoutRound;
                    _matches = Calendar.DrawNoRandomDrawing(this, previousRoundKO);
                }
                else if (previousRound as GroupsRound != null)
                {
                    GroupsRound previousRoundG = previousRound as GroupsRound;
                    _matches = Calendar.DrawNoRandomDrawing(this, previousRoundG);
                }
            }
            else
            {
                _matches = Calendar.Draw(this);
            }
        }
Example #2
0
 public override void Initialise()
 {
     if (!Tournament.IsInternational())
     {
         AddTeamsToRecover();
     }
     //If it's an international tournament (national teams or continental cup eg), we add all teams to recover for all rounds now because ranking can fluctuate after and the same team could be selected for 2 differents rounds
     else if (Tournament.rounds[0] == this)
     {
         foreach (Round r in Tournament.rounds)
         {
             r.AddTeamsToRecover();
         }
     }
     _ranking = null;
 }
        public override void Initialise()
        {
            if (!Tournament.IsInternational())
            {
                AddTeamsToRecover();

                if (this.Tournament.isChampionship)
                {
                    foreach (Club c in clubs)
                    {
                        CityClub cc = c as CityClub;
                        if (cc != null)
                        {
                            int potentialSupporters = GetPotentialSupporters(cc, Tournament.level);
                            if (cc.baseCityAttendanceMultiplier == 0)
                            {
                                float cityAttendanceMultiplier = 1;
                                if (cc.supporters > 0)
                                {
                                    cityAttendanceMultiplier = cc.supporters / (potentialSupporters + 0.0f);
                                }
                                cc.baseCityAttendanceMultiplier = cityAttendanceMultiplier;
                            }
                            c.supporters += (int)(((potentialSupporters - c.supporters) * (Session.Instance.Random(5, 12) / 100.0f)) * cc.baseCityAttendanceMultiplier);
                        }
                    }
                }
            }
            //If it's an international tournament (national teams or continental cup eg), we add all teams to recover for all rounds now because ranking can fluctuate after and the same team could be selected for 2 differents rounds
            else if (Tournament.rounds[0] == this)
            {
                foreach (Round r in Tournament.rounds)
                {
                    r.AddTeamsToRecover();
                }
            }
            _matches = Calendar.GenerateCalendar(this.clubs, this, twoLegs);
        }