public RoyalePublisherGameViewModel(RoyalePublisherGame domain, IClock clock)
 {
     PublisherID      = domain.PublisherID;
     YearQuarter      = new RoyaleYearQuarterViewModel(domain.YearQuarter);
     MasterGame       = new MasterGameYearViewModel(domain.MasterGame, clock);
     Locked           = domain.IsLocked(clock);
     Timestamp        = domain.Timestamp;
     AmountSpent      = domain.AmountSpent;
     AdvertisingMoney = domain.AdvertisingMoney;
     FantasyPoints    = domain.FantasyPoints;
 }
 public RoyalePublisherViewModel(RoyalePublisher domain, IClock clock, int?ranking)
 {
     PublisherID        = domain.PublisherID;
     YearQuarter        = new RoyaleYearQuarterViewModel(domain.YearQuarter);
     PlayerName         = domain.User.DisplayName;
     UserID             = domain.User.UserID;
     PublisherName      = domain.PublisherName;
     PublisherGames     = domain.PublisherGames.Select(x => new RoyalePublisherGameViewModel(x, clock)).ToList();
     Budget             = domain.Budget;
     TotalFantasyPoints = domain.GetTotalFantasyPoints();
     if (TotalFantasyPoints > 0)
     {
         Ranking = ranking;
     }
 }
예제 #3
0
        public RoyalePublisherViewModel(RoyalePublisher domain, IClock clock, int?ranking, IEnumerable <RoyaleYearQuarter> quartersWon)
        {
            PublisherID        = domain.PublisherID;
            YearQuarter        = new RoyaleYearQuarterViewModel(domain.YearQuarter);
            PlayerName         = domain.User.DisplayName;
            UserID             = domain.User.UserID;
            PublisherName      = domain.PublisherName;
            PublisherGames     = domain.PublisherGames.Select(x => new RoyalePublisherGameViewModel(x, clock)).ToList();
            Budget             = domain.Budget;
            TotalFantasyPoints = domain.GetTotalFantasyPoints();
            if (TotalFantasyPoints > 0)
            {
                Ranking = ranking;
            }

            QuartersWon           = quartersWon.Select(x => new RoyaleYearQuarterViewModel(x)).ToList();
            PreviousQuarterWinner = quartersWon.Select(x => x.YearQuarter).Contains(domain.YearQuarter.YearQuarter.LastQuarter);
            OneTimeWinner         = quartersWon.Any();
        }