예제 #1
0
 public LeagueYear(League league, int year, LeagueOptions options, PlayStatus playStatus, IEnumerable <EligibilityOverride> eligibilityOverrides)
 {
     League                          = league;
     Year                            = year;
     Options                         = options;
     PlayStatus                      = playStatus;
     EligibilityOverrides            = eligibilityOverrides.ToList();
     _eligibilityOverridesDictionary = EligibilityOverrides.ToDictionary(x => x.MasterGame);
 }
예제 #2
0
    public LeagueYear(League league, SupportedYear year, LeagueOptions options, PlayStatus playStatus,
                      IEnumerable <EligibilityOverride> eligibilityOverrides, IEnumerable <TagOverride> tagOverrides,
                      Instant?draftStartedTimestamp, FantasyCriticUser?winningUser, IEnumerable <Publisher> publishers)
    {
        League                          = league;
        SupportedYear                   = year;
        Options                         = options;
        PlayStatus                      = playStatus;
        EligibilityOverrides            = eligibilityOverrides.ToList();
        _eligibilityOverridesDictionary = EligibilityOverrides.ToDictionary(x => x.MasterGame);
        TagOverrides                    = tagOverrides.ToList();
        _tagOverridesDictionary         = TagOverrides.ToDictionary(x => x.MasterGame);
        DraftStartedTimestamp           = draftStartedTimestamp;
        WinningUser                     = winningUser;

        _publisherDictionary = publishers.ToDictionary(x => x.PublisherID);
        _managerPublisher    = Publishers.SingleOrDefault(x => x.User.Id == league.LeagueManager.Id);
        StandardGamesTaken   = _publisherDictionary.Values.SelectMany(x => x.PublisherGames).Count(x => !x.CounterPick);
    }