public string PlayerLogUrl(
     PlayerReportModel playerModel)
 {
     return(PlayerLogUrl(
                playerModel.Season,
                playerModel.PlayerName));
 }
        public KickerDetails KickerDetailsFor(
            string season,
            string player,
            string position,
            int[] weeksOfInterest = null)
        {
            if (weeksOfInterest == null)
            {
                weeksOfInterest = new int[]
                {
                    1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16
                }
            }
            ;
            var playerModel = new PlayerReportModel
            {
                Season     = season,
                PlayerName = player,
                Position   = position
            };
            var stats = GetKickerStats(
                model: playerModel);
            var report = SendKickerToMarkdown(
                playerModel,
                weeksOfInterest);
            var kickerDetails = new KickerDetails
            {
                PlayerReportModel = playerModel,
                Stats             = stats,
                Report            = report,
            };

            return(kickerDetails);
        }
 public List <GameStats> GetKickerStats(
     PlayerReportModel model)
 {
     model.GameLog = GetKickerStats(
         model.Season,
         model.PlayerName);
     return(model.GameLog);
 }
 public List <GameStats> GetGameStats(
     PlayerReportModel model)
 {
     model.GameLog = GetPlayerStats(
         model.Season,
         model.PlayerName,
         model.Position);
     return(model.GameLog);
 }
 public void SendKickerLineToConsole(
     PlayerReportModel playerModel)
 {
     Console.Write($"{playerModel.PlayerName,25} ");
     foreach (var game in playerModel.GameLog)
     {
         Console.Write($"{game.PassingTds} {game.FieldGoalsMade} {game.ExtraPointsMade} ");
     }
     Console.WriteLine();
 }
 public void SendLineToConsole(
     PlayerReportModel playerModel)
 {
     Console.Write($"{playerModel.PlayerName,25} ");
     foreach (var game in playerModel.GameLog)
     {
         Console.Write(
             $"{game.RushingTds} {game.ReceivingTds} {game.PassingTds} ");
     }
     Console.WriteLine();
 }
        public List <string> SendKickerToMarkdown(
            PlayerReportModel playerModel,
            int[] weeksOfInterest = null,
            bool sendToObsidian   = false)
        {
            var line = new List <string>();

            if (weeksOfInterest == null)
            {
                weeksOfInterest = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
            }
            ;
            line.Add($"{playerModel.PlayerName} {playerModel.Season}");
            line.Add(string.Empty);
            var totals      = new GameStats();
            var grandtotals = new GameStats();
            var isFirst     = false;

            foreach (var game in playerModel.GameLog)
            {
                if (weeksOfInterest.Contains(
                        game.Week))
                {
                    if (isFirst &&
                        (game.Week.Equals(5) ||
                         game.Week.Equals(9) ||
                         game.Week.Equals(13)))
                    {
                        WriteKickerTotalLine(totals, line);
                        totals = new GameStats();
                        Console.WriteLine();
                    }
                    line.Add($"  {game.KickerStats()}");
                    totals.FieldGoalsMade       += game.FieldGoalsMade;
                    totals.ExtraPointsMade      += game.ExtraPointsMade;
                    grandtotals.FieldGoalsMade  += game.FieldGoalsMade;
                    grandtotals.ExtraPointsMade += game.ExtraPointsMade;
                    isFirst = true;
                }
            }
            WriteKickerTotalLine(totals, line);
            line.Add(string.Empty);
            WriteKickerTotalLine(grandtotals, line);
            line.Add(string.Empty);
            if (sendToObsidian)
            {
                var fileName = $"{playerModel.PlayerName} {playerModel.Season}";
                MarkdownHelper.SendToObsidian(
                    line,
                    fileName);
            }
            return(line);
        }
 public List <GameStats> GetStats(
     PlayerReportModel model)
 {
     if (model.Position != null &&
         model.Position.Equals("KK"))
     {
         model.GameLog = GetKickerStats(
             model.Season,
             model.PlayerName);
         return(model.GameLog);
     }
     return(GetPlayerStats(
                model.Season,
                model.PlayerName,
                model.Position));
 }
        public void SendToConsole(
            PlayerReportModel playerModel,
            int[] weeksOfInterest = null)
        {
            if (weeksOfInterest == null)
            {
                weeksOfInterest = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
            }
            ;
            Console.WriteLine($"{playerModel.PlayerName} {playerModel.Season}");
            Console.WriteLine();
            var totals      = new GameStats();
            var grandtotals = new GameStats();
            var isFirst     = false;

            foreach (var game in playerModel.GameLog)
            {
                if (weeksOfInterest.Contains(
                        game.Week))
                {
                    if (isFirst &&
                        (game.Week.Equals(5) ||
                         game.Week.Equals(9) ||
                         game.Week.Equals(13)))
                    {
                        WriteTotalLine(totals);
                        totals = new GameStats();
                        Console.WriteLine();
                    }
                    Console.WriteLine($"  {game}");
                    totals.PassingTds        += game.PassingTds;
                    totals.RushingTds        += game.RushingTds;
                    totals.ReceivingTds      += game.ReceivingTds;
                    grandtotals.PassingTds   += game.PassingTds;
                    grandtotals.RushingTds   += game.RushingTds;
                    grandtotals.ReceivingTds += game.ReceivingTds;
                    isFirst = true;
                }
            }
            WriteTotalLine(totals);
            Console.WriteLine();
            WriteTotalLine(grandtotals);
            Console.WriteLine();
        }
        public void SendKickerToConsole(
            PlayerReportModel playerModel,
            int[] weeksOfInterest = null)
        {
            if (weeksOfInterest == null)
            {
                weeksOfInterest = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 }
            }
            ;
            Console.WriteLine($"{playerModel.PlayerName} {playerModel.Season}");
            Console.WriteLine();
            var totals      = new GameStats();
            var grandtotals = new GameStats();
            var isFirst     = false;

            foreach (var game in playerModel.GameLog)
            {
                if (weeksOfInterest.Contains(
                        game.Week))
                {
                    if (isFirst &&
                        (game.Week.Equals(5) ||
                         game.Week.Equals(9) ||
                         game.Week.Equals(13)))
                    {
                        WriteKickerTotalLine(totals);
                        totals = new GameStats();
                        Console.WriteLine();
                    }
                    Console.WriteLine($"  {game.KickerStats()}");
                    totals.FieldGoalsMade       += game.FieldGoalsMade;
                    totals.ExtraPointsMade      += game.ExtraPointsMade;
                    grandtotals.FieldGoalsMade  += game.FieldGoalsMade;
                    grandtotals.ExtraPointsMade += game.ExtraPointsMade;
                    isFirst = true;
                }
            }
            WriteKickerTotalLine(totals);
            Console.WriteLine();
            WriteKickerTotalLine(grandtotals);
            Console.WriteLine();
        }
Example #11
0
        private List <PlayerReportModel> GetLogsFor(
            int week,
            string position)
        {
            var thisWeek = new List <PlayerReportModel>();

            foreach (var model in PlayerLogs)
            {
                if (model.Position != position)
                {
                    continue;
                }
                var thisPlayer = new PlayerReportModel(
                    season: model.Season,
                    playerName: model.PlayerName,
                    position: model.Position);
                var thisLog = new List <GameStats>();
                foreach (var g in model.GameLog)
                {
                    thisLog.Add(g);
                }
                foreach (var g in model.GameLog)
                {
                    if (g.Week != week)
                    {
                        continue;
                    }
                    var thisWeeksGame = new List <GameStats>
                    {
                        g
                    };
                    thisLog            = thisWeeksGame;
                    thisPlayer.GameLog = thisLog;
                    thisWeek.Add(thisPlayer);
                }
            }
            return(thisWeek);
        }
Example #12
0
 public void AddLog(
     PlayerReportModel model)
 {
     PlayerLogs.Add(model);
 }