public EventAnalysis(FrcEvent frc) : this()
		{
			Event = frc;
			EventName = frc.EventName;

			foreach (Team t in frc.AllTeams)
			{
				TeamAnalysis ta = new TeamAnalysis(Event, t);
				ta.CalculateSafe();
				TeamData.Add(ta);
			}

			foreach (Match m in frc.Matches)
			{
				MatchAnalysis ma = new MatchAnalysis(Event, m, TeamData);
				ma.CalculatePregame();
				MatchData.Add(ma);
			}
		}
예제 #2
0
        public EventAnalysis(FrcEvent frc) : this()
        {
            Event     = frc;
            EventName = frc.EventName;

            foreach (Team t in frc.AllTeams)
            {
                TeamAnalysis ta = new TeamAnalysis(Event, t);
                ta.CalculateSafe();
                TeamData.Add(ta);
            }

            foreach (Match m in frc.Matches)
            {
                MatchAnalysis ma = new MatchAnalysis(Event, m, TeamData);
                ma.CalculatePregame();
                MatchData.Add(ma);
            }
        }
		private void UpdateMatchPostgame(Match match, MatchAnalysis analysis)
		{
			if (match == null || analysis == null)
			{
				MatchDefenseRedTxt.Text = "NULL";
				MatchDefenseBlueTxt.Text = "NULL";

				MatchGoalCountRedTxt.Text = "NULL";
				MatchGoalCountBlueTxt.Text = "NULL";
				return;
			}

			if (analysis.Pregame)
			{
				MatchDefenseRedTxt.Text = "PREGAME";
				MatchDefenseBlueTxt.Text = "PREGAME";

				MatchGoalCountRedTxt.Text = "PREGAME";
				MatchGoalCountBlueTxt.Text = "PREGAME";
				return;
			}

			MatchDefenseRedTxt.Text = analysis.RedDefenseMean.Value.ToString();
			MatchDefenseBlueTxt.Text = analysis.BlueDefenseMean.Value.ToString();

			MatchGoalCountRedTxt.Text = analysis.RedGoalCount.Value.ToString();
			MatchGoalCountBlueTxt.Text = analysis.BlueGoalCount.Value.ToString();
		}
		private void UpdateMatchPregame(Match match, MatchAnalysis analysis)
		{
			if (match == null || analysis == null)
			{
				MatchWinrateRedTxt.Text = "NULL";
				MatchWinrateBlueTxt.Text = "NULL";

				MatchExpectedWinnerTxt.Text = "NULL";
				MatchExpectedWinnerTxt.Foreground = new SolidColorBrush(TITLE_GRAY);
				MatchAdvantageTxt.Text = "NULL";

				MatchExpectedFinalScoreRedTxt.Text = "NULL";
				MatchExpectedFinalScoreBlueTxt.Text = "NULL";

				MatchProfileTxt.Text = "NULL";
				return;
			}

			MatchWinrateRedTxt.Text = analysis.RedWinRateMean.ToStringPct();
			MatchWinrateBlueTxt.Text = analysis.BlueWinRateMean.ToStringPct();

			MatchExpectedWinnerTxt.Text = analysis.ExpectedWinner.ToString();
			MatchExpectedWinnerTxt.Foreground = new SolidColorBrush(
				analysis.ExpectedWinner == AllianceColor.Red ? 
				LIGHT_RED : LIGHT_BLUE);
			MatchAdvantageTxt.Text = analysis.Advantage.ToString();

			MatchExpectedFinalScoreRedTxt.Text = analysis.RedExpectedFinalScore.ToString();
			MatchExpectedFinalScoreBlueTxt.Text = analysis.BlueExpectedFinalScore.ToString();

			MatchProfileTxt.Text = analysis.GameProfileValue.ToString();
		}