Exemple #1
0
        private PlayerStats GetPlayerStats(JToken rawData, int playerNumber)
        {
            var groups = rawData["PlayerGroups"];

            var passingStats = groups["Passing"]["Values"];
            var rushingStats = groups["Rushing"]["Values"];
            var receivingStats = groups["Receiving"]["Values"];

            var playerPassing = from Values in passingStats
                                where Values["Uni"].Value<string>() == playerNumber.ToString()
                                select Values;

            var playerRushing = from Values in rushingStats
                                where Values["Uni"].Value<string>() == playerNumber.ToString()
                                select Values;

            var playerReceiving = from Values in receivingStats
                                  where Values["Uni"].Value<string>() == playerNumber.ToString()
                                  select Values;

            var stats = new PlayerStats();
            stats.PassStats = GetPlayerPassingStats(playerPassing, playerNumber);
            stats.RushStats = GetPlayerRushingStats(playerRushing, playerNumber);
            stats.RecStats = GetPlayerReceivingStats(playerReceiving, playerNumber);

            return stats;
        }
Exemple #2
0
 private void GetHomePlayerData(object sender, DoWorkEventArgs e)
 {
     _homePlayerStats = dataService.GetHomePlayerDataByPlayerNumber(_homePlayer.Number);
 }
Exemple #3
0
 private void UpdatePlayerCG(Team.Player player, PlayerStats stats, string superToShow, string logo)
 {
     if (!CGOverrideCheck.Checked)
     {
         CG.BugVisible = false;
         var command = CG.PlayerCGCommand(player, stats, superToShow, logo);
         if (!String.IsNullOrEmpty(command))
         {
             lyricService.Send(command);
             lyricService.Send("V\\5\\3\\1\\1\\100\\1\\\\");
         }
     }
 }
Exemple #4
0
        public String PlayerCGCommand(Team.Player player, PlayerStats stats, string superToShow, string logo)
        {
            string returnString = SetDissolve();

            switch(superToShow)
            {
                case "Bio":
                    returnString = returnString + "W\\100\\1001\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\" + player.Height + "\\" + player.Weight + "\\" + player.Year + "\\" + player.Hometown + "\\" + logo + "\\\\";
                    return returnString;
                case "Passing":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Comp\\Att\\Yards\\TD\\";
                    if (stats != null)
                    {
                        if (stats.PassStats.PassingInt > 0)
                        {
                            returnString = returnString + "Int\\" + stats.PassStats.PassingCompletions + "\\" + stats.PassStats.PassingAttempts + "\\" + stats.PassStats.PassingYards + "\\" + stats.PassStats.PassingTd + "\\" + stats.PassStats.PassingInt + "\\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + "\\ \\" + stats.PassStats.PassingCompletions + "\\" + stats.PassStats.PassingAttempts + "\\" + stats.PassStats.PassingYards + "\\" + stats.PassStats.PassingTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
                case "Rushing":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Att\\Yards\\Avg\\";
                    if (stats != null)
                    {
                        if (stats.RushStats.RushTd > 0)
                        {
                            returnString = returnString + "TD\\ \\" + stats.RushStats.RushAttempts + "\\" + stats.RushStats.RushYards + "\\" + stats.RushStats.RushAverage + "\\" + stats.RushStats.RushTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + " \\ \\" + stats.RushStats.RushAttempts + "\\" + stats.RushStats.RushYards + "\\" + stats.RushStats.RushAverage + "\\ \\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
                case "Receiving":
                    returnString = returnString + "W\\100\\1004\\" + player.Number + "\\" + player.Name + "\\" + player.Position + "\\Rec\\Yards\\Avg\\";
                    if (stats != null)
                    {
                        if (stats.RecStats.ReceivingTd > 0)
                        {
                            returnString = returnString + "TD\\ \\" + stats.RecStats.Receptions + "\\" + stats.RecStats.ReceivingYards + "\\" + stats.RecStats.ReceivingAverage + "\\" + stats.RecStats.ReceivingTd + "\\ \\Today\\" + logo + "\\\\";
                        }
                        else
                        {
                            returnString = returnString + " \\ \\" + stats.RecStats.Receptions + "\\" + stats.RecStats.ReceivingYards + "\\" + stats.RecStats.ReceivingAverage + "\\ \\ \\Today\\" + logo + "\\\\";
                        }
                    }
                    return returnString;
            }

            return returnString;
        }