Exemplo n.º 1
0
            public MatchResultsForDisplay ToMatchResultsForDisplay()
            {
                MatchResultsForDisplay mrfd = new MatchResultsForDisplay();
                StringBuilder          sb   = new StringBuilder();

                mrfd.Type = this.Type;

                if (this.DisplayName.StartsWith("Q") || this.DisplayName.StartsWith("S") || this.DisplayName.StartsWith("F"))
                {
                    mrfd.DisplayName = this.DisplayName;
                }
                else
                {
                    mrfd.DisplayName = "Q" + this.DisplayName;
                }

                mrfd.RedAlliance = GetRedAllianceString();

                mrfd.BlueAlliance = GetBlueAllianceString();

                if (this.Result != null)
                {
                    mrfd.RedScore  = this.Result.RedScore.GetTotal();
                    mrfd.BlueScore = this.Result.BlueScore.GetTotal();

                    mrfd.RedAutoScore  = this.Result.RedScore.GetAutoPoints();
                    mrfd.BlueAutoScore = this.Result.BlueScore.GetAutoPoints();

                    mrfd.RedFoulPoints  = this.Result.RedScore.GetFoulPoints();
                    mrfd.BlueFoulPoints = this.Result.BlueScore.GetFoulPoints();

                    mrfd.RedCappedStacks  = this.Result.RedScore.GetCappedStacks();
                    mrfd.BlueCappedStacks = this.Result.BlueScore.GetCappedStacks();

                    mrfd.RedCanEfficiency  = Math.Round(this.Result.RedScore.GetCanEfficiencyRatio() * 100, 2);
                    mrfd.BlueCanEfficiency = Math.Round(this.Result.BlueScore.GetCanEfficiencyRatio() * 100, 2);


                    mrfd.CoopertitionSet   = this.Result.BlueScore.CoopertitionSet;
                    mrfd.CoopertitionStack = this.Result.BlueScore.CoopertitionStack;
                }
                else
                {
                    mrfd.RedScore  = 0;
                    mrfd.BlueScore = 0;

                    mrfd.CoopertitionSet   = false;
                    mrfd.CoopertitionStack = false;
                }

                mrfd.Status = this.Status;
                mrfd.Winner = this.Winner;

                return(mrfd);
            }
Exemplo n.º 2
0
            public MatchResultsForDisplay ToMatchResultsForDisplay()
            {
                MatchResultsForDisplay mrfd = new MatchResultsForDisplay();
                StringBuilder sb = new StringBuilder();

                mrfd.Type = this.Type;

                if (this.DisplayName.StartsWith("Q") || this.DisplayName.StartsWith("S") || this.DisplayName.StartsWith("F"))
                {
                    mrfd.DisplayName = this.DisplayName;
                }
                else
                {
                    mrfd.DisplayName = "Q" + this.DisplayName;
                }

                mrfd.RedAlliance = GetRedAllianceString();

                mrfd.BlueAlliance = GetBlueAllianceString();

                if (this.Result != null)
                {
                    mrfd.RedScore = this.Result.RedScore.GetTotal();
                    mrfd.BlueScore = this.Result.BlueScore.GetTotal();

                    mrfd.RedAutoScore = this.Result.RedScore.GetAutoPoints();
                    mrfd.BlueAutoScore = this.Result.BlueScore.GetAutoPoints();

                    mrfd.RedFoulPoints = this.Result.RedScore.GetFoulPoints();
                    mrfd.BlueFoulPoints = this.Result.BlueScore.GetFoulPoints();

                    mrfd.RedCappedStacks = this.Result.RedScore.GetCappedStacks();
                    mrfd.BlueCappedStacks = this.Result.BlueScore.GetCappedStacks();

                    mrfd.RedCanEfficiency = Math.Round(this.Result.RedScore.GetCanEfficiencyRatio()*100,2);
                    mrfd.BlueCanEfficiency = Math.Round(this.Result.BlueScore.GetCanEfficiencyRatio()*100, 2);

                    mrfd.CoopertitionSet = this.Result.BlueScore.CoopertitionSet;
                    mrfd.CoopertitionStack = this.Result.BlueScore.CoopertitionStack;
                }
                else
                {
                    mrfd.RedScore = 0;
                    mrfd.BlueScore = 0;

                    mrfd.CoopertitionSet = false;
                    mrfd.CoopertitionStack = false;
                }

                mrfd.Status = this.Status;
                mrfd.Winner = this.Winner;

                return mrfd;
            }