/// <summary>
 /// Calculation Match Result From Games
 /// </summary>
 protected override void InnerCalculateResultFromGames(PlayerMatch match)
 {
     this.CalculateChalksFromGames(match);
     this.CalculateGamesScoreFromGames(match);
     this.CalculateResultType(match);
     match.SetAuditFields();
 }
Exemplo n.º 2
0
        protected virtual PlayerMatch CreateMatch(bool entrant1Home)
        {
            if (this._matches.Count == this.Legs)
            {
                throw new InvalidOperationException("Too many Matches added for this fixture.  Fixture already has enough matches for the configured number of legs.");
            }

            var matchFormat = this.CompetitionRound.CompetitionEvent.GetMatchFormat();
            var leg         = (byte)(this._matches.Count + 1);
            var match       = new PlayerMatch
            {
                PlayerFixture = this,
                Date          = this.PendingDate.Value,
                Leg           = leg,
                MatchFormat   = matchFormat,
                MatchStatusID = MatchStatuses.Pending
            };

            match.MatchCalculationEngineID = this.CompetitionRound.CompetitionEvent.GetMatchCalculationEngine();
            match.Home        = entrant1Home ? this.Entrant1 : this.Entrant2;
            match.Away        = entrant1Home ? this.Entrant2 : this.Entrant1;
            match.VenueTypeID = this.PendingVenueTypeID.Value;
            match.Pitch       = this.ResolvePitch();

            if (leg == 1 && match.Pitch != null)
            {
                match.SetIncomplete();
            }
            else
            {
                match.SetAuditFields();
            }

            this._matches.Add(match);
            return(match);
        }