public async Task SetWalkover(ISetMatchWalkoverRequest request) { short homeChalks = 0; short homeGames = 0; short awayGames = 0; short awayChalks = 0; foreach (var gameConfig in this.Data.MatchFormat.GameVariations) { var calculationEngine = this._gameCalculationEngineFactory.Create(gameConfig.GameCalculationEngineID); if (request.Walkover == Walkover.Home) { homeChalks += calculationEngine.GameScoreTarget; awayChalks += gameConfig.Handicap ?? 0; homeGames++; } else { awayChalks += calculationEngine.GameScoreTarget; homeChalks += gameConfig.Handicap ?? 0; awayGames++; } } var config = await this.GetMatchCalculationEngineConfiguration(); await this._teamMatchCalculationEngine.OverrideAndCalculate(this.Data, homeGames, homeChalks, awayGames, awayChalks, config); this.Data.HomeWalkover = WalkoverHelper.MapHomeWalkoverValue(request.Walkover); this.Data.AwayWalkover = WalkoverHelper.MapAwayWalkoverValue(request.Walkover); }
protected void SetCommonGameValues(TData gameData, GameResult gameResult, MatchFormatXGameVariation matchConfiguration) { gameData.GameStatusID = GameStatuses.Standard; gameData.HomeWalkover = WalkoverHelper.MapHomeWalkoverValue(gameResult.Walkover); gameData.AwayWalkover = WalkoverHelper.MapAwayWalkoverValue(gameResult.Walkover); gameData.HomeHandicap = gameResult.HomeHandicap; gameData.AwayHandicap = gameResult.AwayHandicap; gameData.HomeScore = gameResult.HomeScore; gameData.AwayScore = gameResult.AwayScore; gameData.GameVariation = matchConfiguration.GameVariation; gameData.GameCalculationEngineID = matchConfiguration.GameCalculationEngineID; }
public void SetWalkover(Walkover walkover) { this.Data.HomeWalkover = WalkoverHelper.MapHomeWalkoverValue(walkover); this.Data.AwayWalkover = WalkoverHelper.MapAwayWalkoverValue(walkover); }
public void SetNoWalkover() { this.Data.HomeWalkover = WalkoverHelper.MapHomeWalkoverValue(Walkover.None); this.Data.AwayWalkover = WalkoverHelper.MapAwayWalkoverValue(Walkover.None); }