예제 #1
0
    public LeagueYearSettingsViewModel(Guid leagueID, int year, int standardGames, int gamesToDraft, int counterPicks,
                                       int counterPicksToDraft, int freeDroppableGames, int willNotReleaseDroppableGames, int willReleaseDroppableGames, bool unlimitedFreeDroppableGames,
                                       bool unlimitedWillNotReleaseDroppableGames, bool unlimitedWillReleaseDroppableGames, bool dropOnlyDraftGames, bool counterPicksBlockDrops,
                                       int minimumBidAmount, string draftSystem, string pickupSystem, string scoringSystem, string tradingSystem, string tiebreakSystem,
                                       LocalDate counterPickDeadline, LeagueTagOptionsViewModel tags, List <SpecialGameSlotViewModel> specialGameSlots)
    {
        LeagueID                              = leagueID;
        Year                                  = year;
        StandardGames                         = standardGames;
        GamesToDraft                          = gamesToDraft;
        CounterPicks                          = counterPicks;
        CounterPicksToDraft                   = counterPicksToDraft;
        FreeDroppableGames                    = freeDroppableGames;
        WillNotReleaseDroppableGames          = willNotReleaseDroppableGames;
        WillReleaseDroppableGames             = willReleaseDroppableGames;
        UnlimitedFreeDroppableGames           = unlimitedFreeDroppableGames;
        UnlimitedWillNotReleaseDroppableGames = unlimitedWillNotReleaseDroppableGames;
        UnlimitedWillReleaseDroppableGames    = unlimitedWillReleaseDroppableGames;
        DropOnlyDraftGames                    = dropOnlyDraftGames;
        CounterPicksBlockDrops                = counterPicksBlockDrops;
        MinimumBidAmount                      = minimumBidAmount;
        DraftSystem                           = draftSystem;
        PickupSystem                          = pickupSystem;
        ScoringSystem                         = scoringSystem;
        TradingSystem                         = tradingSystem;
        TiebreakSystem                        = tiebreakSystem;
        CounterPickDeadline                   = counterPickDeadline;

        Tags             = tags;
        SpecialGameSlots = specialGameSlots;
    }
예제 #2
0
    public LeagueYearSettingsViewModel(LeagueYear leagueYear)
    {
        LeagueID            = leagueYear.League.LeagueID;
        Year                = leagueYear.Year;
        StandardGames       = leagueYear.Options.StandardGames;
        GamesToDraft        = leagueYear.Options.GamesToDraft;
        CounterPicks        = leagueYear.Options.CounterPicks;
        CounterPicksToDraft = leagueYear.Options.CounterPicksToDraft;

        FreeDroppableGames = leagueYear.Options.FreeDroppableGames;
        if (leagueYear.Options.FreeDroppableGames == -1)
        {
            FreeDroppableGames          = 0;
            UnlimitedFreeDroppableGames = true;
        }
        WillNotReleaseDroppableGames = leagueYear.Options.WillNotReleaseDroppableGames;
        if (leagueYear.Options.WillNotReleaseDroppableGames == -1)
        {
            WillNotReleaseDroppableGames          = 0;
            UnlimitedWillNotReleaseDroppableGames = true;
        }
        WillReleaseDroppableGames = leagueYear.Options.WillReleaseDroppableGames;
        if (leagueYear.Options.WillReleaseDroppableGames == -1)
        {
            WillReleaseDroppableGames          = 0;
            UnlimitedWillReleaseDroppableGames = true;
        }
        DropOnlyDraftGames     = leagueYear.Options.DropOnlyDraftGames;
        CounterPicksBlockDrops = leagueYear.Options.CounterPicksBlockDrops;
        MinimumBidAmount       = leagueYear.Options.MinimumBidAmount;

        DraftSystem         = leagueYear.Options.DraftSystem.Value;
        PickupSystem        = leagueYear.Options.PickupSystem.Value;
        TiebreakSystem      = leagueYear.Options.TiebreakSystem.Value;
        ScoringSystem       = leagueYear.Options.ScoringSystem.Name;
        TradingSystem       = leagueYear.Options.TradingSystem.Value;
        CounterPickDeadline = leagueYear.CounterPickDeadline;

        var bannedTags = leagueYear.Options.LeagueTags
                         .Where(x => x.Status == TagStatus.Banned)
                         .Select(x => x.Tag.Name)
                         .ToList();

        var requiredTags = leagueYear.Options.LeagueTags
                           .Where(x => x.Status == TagStatus.Required)
                           .Select(x => x.Tag.Name)
                           .ToList();

        Tags             = new LeagueTagOptionsViewModel(bannedTags, requiredTags);
        SpecialGameSlots = leagueYear.Options.SpecialGameSlots.Select(x => new SpecialGameSlotViewModel(x)).ToList();
    }