public LeagueOptions UpdateOptionsForYear(int requestYear) { var newScoringSystem = ScoringSystem.GetDefaultScoringSystem(requestYear); LeagueOptions options = new LeagueOptions(StandardGames, GamesToDraft, CounterPicks, CounterPicksToDraft, FreeDroppableGames, WillNotReleaseDroppableGames, WillReleaseDroppableGames, DropOnlyDraftGames, CounterPicksBlockDrops, MinimumBidAmount, LeagueTags, SpecialGameSlots, DraftSystem, PickupSystem, newScoringSystem, TradingSystem, TiebreakSystem, CounterPickDeadline); return(options); }
public decimal GetRoyaleGameCost() { decimal projectedPoints = ScoringSystem.GetDefaultScoringSystem(Year).GetPointsForScore(Convert.ToDecimal(LinearRegressionHypeFactor), false); projectedPoints *= 1.5m; if (projectedPoints < 2m) { projectedPoints = 2m; } return(projectedPoints); }
public MasterGameYearViewModel(MasterGameYear masterGame, LocalDate currentDate) { MasterGameID = masterGame.MasterGame.MasterGameID; Year = masterGame.Year; GameName = masterGame.MasterGame.GameName; EstimatedReleaseDate = masterGame.MasterGame.EstimatedReleaseDate; MinimumReleaseDate = masterGame.MasterGame.MinimumReleaseDate; MaximumReleaseDate = masterGame.MasterGame.GetDefiniteMaximumReleaseDate(); EarlyAccessReleaseDate = masterGame.MasterGame.EarlyAccessReleaseDate; InternationalReleaseDate = masterGame.MasterGame.InternationalReleaseDate; AnnouncementDate = masterGame.MasterGame.AnnouncementDate; ReleaseDate = masterGame.MasterGame.ReleaseDate; IsReleased = masterGame.MasterGame.IsReleased(currentDate); WillRelease = masterGame.WillRelease(); DelayContention = masterGame.MasterGame.DelayContention; CriticScore = masterGame.MasterGame.CriticScore; FantasyPoints = masterGame.GetFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false, currentDate); AveragedScore = masterGame.MasterGame.AveragedScore; OpenCriticID = masterGame.MasterGame.OpenCriticID; GGToken = masterGame.MasterGame.GGToken; SubGames = masterGame.MasterGame.SubGames.Select(x => new MasterGameYearViewModel(x, masterGame, currentDate)).ToList(); Tags = masterGame.MasterGame.Tags.Select(x => x.Name).ToList(); ReadableTags = masterGame.MasterGame.Tags.Select(x => x.ReadableName).ToList(); BoxartFileName = masterGame.MasterGame.BoxartFileName; GGCoverArtFileName = masterGame.MasterGame.GGCoverArtFileName; PercentStandardGame = masterGame.PercentStandardGame; PercentCounterPick = masterGame.PercentCounterPick; AdjustedPercentCounterPick = masterGame.AdjustedPercentCounterPick; if (masterGame.MasterGame.EligibilityChanged) { EligiblePercentStandardGame = masterGame.PercentStandardGame; } else { EligiblePercentStandardGame = masterGame.EligiblePercentStandardGame; } AverageDraftPosition = masterGame.AverageDraftPosition; HypeFactor = masterGame.HypeFactor; DateAdjustedHypeFactor = masterGame.DateAdjustedHypeFactor; PeakHypeFactor = masterGame.PeakHypeFactor; ProjectedFantasyPoints = masterGame.GetProjectedFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false); ProjectedOrRealFantasyPoints = FantasyPoints ?? ProjectedFantasyPoints; AddedTimestamp = masterGame.MasterGame.AddedTimestamp; }
public MasterGameYearViewModel(MasterSubGame masterSubGame, MasterGameYear masterGame, LocalDate currentDate) { MasterGameID = masterSubGame.MasterGameID; Year = masterGame.Year; GameName = masterSubGame.GameName; EstimatedReleaseDate = masterSubGame.EstimatedReleaseDate; MinimumReleaseDate = masterSubGame.MinimumReleaseDate; MaximumReleaseDate = masterSubGame.GetDefiniteMaximumReleaseDate(); ReleaseDate = masterGame.MasterGame.ReleaseDate; IsReleased = masterGame.MasterGame.IsReleased(currentDate); WillRelease = masterGame.WillRelease(); CriticScore = masterSubGame.CriticScore; FantasyPoints = masterGame.GetFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false, currentDate); AveragedScore = false; OpenCriticID = masterSubGame.OpenCriticID; SubGames = null; Tags = new List <string>(); ReadableTags = new List <string>(); PercentStandardGame = masterGame.PercentStandardGame; PercentCounterPick = masterGame.PercentCounterPick; AdjustedPercentCounterPick = masterGame.AdjustedPercentCounterPick; if (masterGame.MasterGame.EligibilityChanged) { EligiblePercentStandardGame = masterGame.PercentStandardGame; } else { EligiblePercentStandardGame = masterGame.EligiblePercentStandardGame; } AverageDraftPosition = masterGame.AverageDraftPosition; HypeFactor = masterGame.HypeFactor; DateAdjustedHypeFactor = masterGame.DateAdjustedHypeFactor; PeakHypeFactor = masterGame.PeakHypeFactor; ProjectedFantasyPoints = masterGame.GetProjectedFantasyPoints(ScoringSystem.GetDefaultScoringSystem(Year), false); ProjectedOrRealFantasyPoints = FantasyPoints ?? ProjectedFantasyPoints; AddedTimestamp = masterGame.MasterGame.AddedTimestamp; }
public decimal?CalculateFantasyPoints(LocalDate currentDate, IEnumerable <MasterGameTag> allMasterGameTags) { if (!MasterGame.MasterGame.IsReleased(currentDate)) { return(0m); } if (CalculateIsCurrentlyIneligible(allMasterGameTags)) { return(0m); } var basePoints = MasterGame.GetFantasyPoints(ScoringSystem.GetDefaultScoringSystem(YearQuarter.YearQuarter.Year), false, currentDate); if (!basePoints.HasValue) { return(null); } var extraPoints = basePoints * AdvertisingMoney * 0.05m; var modifiedPoints = basePoints + extraPoints; return(modifiedPoints); }
public async Task <IReadOnlyList <MasterGameYear> > GetMasterGamesForYearQuarter(YearQuarter yearQuarter) { IEnumerable <MasterGameYear> masterGameYears = await _masterGameRepo.GetMasterGameYears(yearQuarter.Year); var currentDate = _clock.GetToday(); masterGameYears = masterGameYears.Where(x => !x.MasterGame.ReleaseDate.HasValue || x.MasterGame.ReleaseDate >= yearQuarter.FirstDateOfQuarter); masterGameYears = masterGameYears.OrderByDescending(x => x.GetProjectedFantasyPoints(ScoringSystem.GetDefaultScoringSystem(yearQuarter.Year), false)); return(masterGameYears.ToList()); }