void ShowStatisticsData(Guid matchId, int matchCount, BatchManagerEntity home, BatchManagerEntity away) { string title = "所有场次平均"; if (matchCount > 0) { title = "场次: " + matchCount; if (_testStatisticsDic.ContainsKey(_selectMatchId)) { btnViewStatistics.IsEnabled = true; } else { btnViewStatistics.IsEnabled = false; } btnViewEmulator.IsEnabled = true; btnViewAvg.IsEnabled = true; lblMatchId.Content = "比赛id: " + matchId; } else { btnViewStatistics.IsEnabled = false; btnViewEmulator.IsEnabled = false; btnViewAvg.IsEnabled = false; lblMatchId.Content = title; } _selectMatchId = matchCount; lblMatchCount.Content = title; BatchDataControl1.SetData(home); BatchDataControl2.SetData(away); }
public void SetTotal(BatchManagerEntity batchManagerEntity) { ShootTimes = batchManagerEntity.TotalShoot.ShootTimes; GoalTimes = batchManagerEntity.TotalShoot.GoalTimes; DiveTimes = batchManagerEntity.GoalKeep.Times; DiveSuccTimes = batchManagerEntity.GoalKeep.SuccTimes; DiveFailTimes = batchManagerEntity.GoalKeep.FailTimes; PassTimes = batchManagerEntity.TotalPass.Times; PassSuccTimes = batchManagerEntity.TotalPass.SuccTimes; }
public BatchMatchEntity(Guid matchId, int id, long cost, MatchReport match) { MatchId = matchId; Id = id; Cost = cost; Round = EmulatorHelper.GetMaxRound(match); HomeManager = new BatchManagerEntity(match, Round, true); AwayManager = new BatchManagerEntity(match, Round, false); HomeScore = match.HomeScore; AwayScore = match.AwayScore; }
public void SetData(BatchManagerEntity manager) { lblScore.Content = "得分:" + manager.Score; lblControlTime.Content = string.Format("控球时间占比:{0:f1}", manager.ControlRound * 100.00 / manager.TotalRound); lblGoal.Content = "进球数:" + manager.TotalShoot.GoalTimes; lblShootCount.Content = "射门次数:" + manager.TotalShoot.ShootTimes; lblDoorframeCount.Content = "射中门框次数:" + manager.TotalShoot.DoorFrame; lblGoalKeepCount.Content = "扑救次数:" + manager.GoalKeep.Times; lblGoalKeepSuccessCount.Content = "扑救成功次数:" + manager.GoalKeep.SuccTimes; lblGoalKeepFailCount.Content = "脱手次数:" + manager.GoalKeep.FailTimes; lblPassCount.Content = "传球次数:" + manager.TotalPass.Times; lblPassRate.Content = "传球成功率:" + manager.TotalPass.RateStr; lblShortPassCount.Content = "短传次数:" + manager.ShortPass.Times; lblShortPassRate.Content = "短传成功率:" + manager.ShortPass.RateStr; lblLongPassCount.Content = "长传次数:" + manager.LongPass.Times; lblLongPassRate.Content = "长传成功率:" + manager.LongPass.RateStr; lblHeadPassCount.Content = "头球次数:" + manager.HeadPass.Times; lblHeadPassRate.Content = "头球成功率:" + manager.HeadPass.RateStr; lblStealsCount.Content = "抢断次数:" + manager.Steal.Times; lblStealsRate.Content = "抢断成功率:" + manager.Steal.RateStr; lblBreakThroughCount.Content = "过人次数:" + manager.Breakthrough.Times; lblBreakThroughRate.Content = "过人成功率:" + manager.Breakthrough.RateStr; lblFoulCount.Content = "犯规次数:" + manager.Foul.FoulTimes; lblFoulRedCount.Content = "红牌数:" + manager.Foul.RedTimes; lblFoulYellowCount.Content = "黄牌数:" + manager.Foul.YellowTimes; lblInjuredCount.Content = "受伤次数:" + manager.InjuredTimes; lblRebelShootCount.Content = "乌龙次数:" + manager.RebelShoot.ShootTimes; lblRebelShootGoal.Content = "乌龙进球数:" + manager.RebelShoot.GoalTimes; }
public void FinishCallback() { DataGridMatchList.ItemsSource = _testMatchList; #region CalAvg _homeStatistics = new BatchManagerEntity(); _awayStatistics = new BatchManagerEntity(); _winTimes = 0; _drawTimes = 0; foreach (var entity in _testMatchList) { _homeStatistics.AddData(entity.HomeManager); _awayStatistics.AddData(entity.AwayManager); if (entity.HomeScore > entity.AwayScore) { _winTimes++; } else if (entity.HomeScore == entity.AwayScore) { _drawTimes++; } } _homeStatistics.CalAvg(_matchTimes); _awayStatistics.CalAvg(_matchTimes); #endregion ShowStatisticsData(Guid.Empty, 0, _homeStatistics, _awayStatistics); btnViewAvg.IsEnabled = true; int totalTimes = _matchTimes - _drawTimes; double winRate = 0; if (totalTimes != 0) { winRate = _winTimes * 100 / totalTimes; } lblResult.Content = string.Format("场次:{0} 主队胜场:{3} 主队胜率:{1:f0}% 平局:{2} ", _matchTimes, winRate, _drawTimes, _winTimes); }