Exemplo n.º 1
0
        public bool IsItPreseason()
        {
            if (ScheduleAvailable)
            {
                var now = SystemClock.Now;
                return(now < SeasonStarts.AddDays(1));
            }
            var month = SystemClock.GetMonth();

            return(month >= 3 && month < 9);
        }
Exemplo n.º 2
0
        public bool IsItRegularSeason()
        {
            if (ScheduleAvailable)
            {
                var now = SystemClock.Now;
                //  add a day for Aus time
                return(now >= SeasonStarts.AddDays(1) && now <= RegularSeasonEnds);
            }
            var month = SystemClock.GetMonth();

            return(month >= 9 && month <= 12);
        }
Exemplo n.º 3
0
        public PlayerGameLogViewModel DumpSeason()
        {
            SetFantasyTeam();
            var totalLog = new PlayerGameLogViewModel
            {
                HasGame = true
            };
            var playerSlug = Utility.PlayerSlug(Player);

            for (int d = 0; d < (6 * 30); d++)
            {
                var queryDate = SeasonStarts.AddDays(d);
                if (queryDate.Equals(DateTime.Now.Date.AddDays(-1)))
                {
                    break;
                }

                var logResult = _gameLogRepository.Submit(
                    queryDate: queryDate,
                    playerSlug: playerSlug);

                if (logResult.IsSuccess)
                {
                    var log = logResult.Value;
                    totalLog.Add(log);
                    if (log.HasGame)
                    {
                        totalLog.IsPitcher = log.IsPitcher;
                        totalLog.IsBatter  = log.IsBatter;
                    }
                    if (d == 0)
                    {
                        DisplayHeading(log, _rosterMaster);
                    }
                    if (log.HasGame)
                    {
                        Console.WriteLine(log.DateLine());
                    }
                }
            }
            DisplayTotals(totalLog);
            return(totalLog);
        }