Example #1
0
    public decimal?GetFantasyPoints(bool gameIsValidInSlot, ScoringSystem scoringSystem, LocalDate currentDate)
    {
        if (PublisherGame is null)
        {
            return(null);
        }
        if (PublisherGame.ManualCriticScore.HasValue)
        {
            return(scoringSystem.GetPointsForScore(PublisherGame.ManualCriticScore.Value, CounterPick));
        }
        if (PublisherGame.MasterGame is null)
        {
            return(null);
        }

        var calculatedScore = PublisherGame.MasterGame.GetFantasyPoints(scoringSystem, CounterPick, currentDate);

        if (gameIsValidInSlot)
        {
            return(calculatedScore);
        }

        if (calculatedScore.HasValue && calculatedScore.Value <= 0m)
        {
            return(calculatedScore);
        }

        return(0m);
    }
        public decimal GetProjectedOrRealFantasyPoints(ScoringSystem scoringSystem, bool counterPick, IClock clock)
        {
            decimal?fantasyPoints = CalculateFantasyPoints(scoringSystem, counterPick, clock, false);

            if (fantasyPoints.HasValue)
            {
                return(fantasyPoints.Value);
            }

            return(scoringSystem.GetPointsForScore(Convert.ToDecimal(LinearRegressionHypeFactor), counterPick));
        }
Example #3
0
        public decimal?CalculateFantasyPoints(ScoringSystem scoringSystem, IClock clock)
        {
            if (ManualCriticScore.HasValue)
            {
                return(scoringSystem.GetPointsForScore(ManualCriticScore.Value, CounterPick));
            }
            if (MasterGame.HasNoValue)
            {
                return(null);
            }

            return(MasterGame.Value.CalculateFantasyPoints(scoringSystem, CounterPick, clock, true));
        }
        public decimal?CalculateFantasyPoints(ScoringSystem scoringSystem, bool counterPick, IClock clock, bool mustBeReleased)
        {
            if (!WillRelease())
            {
                return(0m);
            }

            if (mustBeReleased && !MasterGame.IsReleased(clock.GetCurrentInstant()))
            {
                return(null);
            }

            if (MasterGame.CriticScore.HasValue)
            {
                return(scoringSystem.GetPointsForScore(MasterGame.CriticScore.Value, counterPick));
            }

            return(null);
        }
Example #5
0
    public decimal?GetFantasyPoints(ScoringSystem scoringSystem, bool counterPick, LocalDate currentDate)
    {
        if (!WillRelease())
        {
            return(0m);
        }

        if (!MasterGame.IsReleased(currentDate))
        {
            return(null);
        }

        if (MasterGame.CriticScore.HasValue)
        {
            return(scoringSystem.GetPointsForScore(MasterGame.CriticScore.Value, counterPick));
        }

        return(null);
    }
 public decimal GetAlwaysProjectedFantasyPoints(ScoringSystem scoringSystem, bool counterPick)
 {
     return(scoringSystem.GetPointsForScore(Convert.ToDecimal(LinearRegressionHypeFactor), counterPick));
 }