Exemplo n.º 1
0
        public virtual ActionResult Index()
        {
            var recentPlayerAchievements = _recentPlayerAchievementsUnlockedRetreiver.GetResults(new GetRecentPlayerAchievementsUnlockedQuery {
                PageSize = NUMBER_OF_RECENT_ACHIEVEMENTS_TO_SHOW
            });
            var recentPlayerAchievementsViewModel =
                recentPlayerAchievements.ToMappedPagedList(_mapperFactory.GetMapper <PlayerAchievement, PlayerAchievementWinnerViewModel>());

            var recentlyPlayedGamesFilter = new RecentlyPlayedGamesFilter
            {
                NumberOfGamesToRetrieve = NUMBER_OF_RECENT_PUBLIC_GAMES_TO_SHOW
            };
            var publicGameSummaries = _recentPublicGamesRetriever.GetResults(recentlyPlayedGamesFilter);

            var topGamingGroups = _topGamingGroupsRetriever.GetResults(NUMBER_OF_TOP_GAMING_GROUPS_TO_SHOW);

            var topGamingGroupViewModels = topGamingGroups.Select(_transformer.Transform <TopGamingGroupSummaryViewModel>).ToList();

            var trendingGamesRequest   = new TrendingGamesRequest(NUMBER_OF_TRENDING_GAMES_TO_SHOW, NUMBER_OF_DAYS_OF_TRENDING_GAMES);
            var trendingGames          = _trendingGamesRetriever.GetResults(trendingGamesRequest);
            var trendingGameViewModels = trendingGames.Select(_transformer.Transform <TrendingGameViewModel>).ToList();

            var homeIndexViewModel = new HomeIndexViewModel()
            {
                RecentAchievementsUnlocked = recentPlayerAchievementsViewModel,
                RecentPublicGames          = publicGameSummaries,
                TopGamingGroups            = topGamingGroupViewModels,
                TrendingGames = trendingGameViewModels
            };

            ViewBag.NumTrendingGameDays = NUMBER_OF_DAYS_OF_TRENDING_GAMES;
            return(View(MVC.Home.Views.Index, homeIndexViewModel));
        }
        internal virtual List <TrendingGameViewModel> GetTrendingGamesViewModels(int numberOfGames, int numberOfDays)
        {
            var trendingGamesRequest =
                new TrendingGamesRequest(numberOfGames, numberOfDays);
            var trendingGames = _trendingGamesRetriever.GetResults(trendingGamesRequest);

            return(trendingGames.Select(_transformer.Transform <TrendingGameViewModel>).ToList());
        }
Exemplo n.º 3
0
        public virtual ActionResult TrendingGames()
        {
            var trendingGamesRequest   = new TrendingGamesRequest(NUMBER_OF_TRENDING_GAMES_TO_SHOW, NUMBER_OF_DAYS_OF_TRENDING_GAMES);
            var trendingGames          = _trendingGamesRetriever.GetResults(trendingGamesRequest);
            var trendingGameViewModels = trendingGames.Select(_transformer.Transform <TrendingGameViewModel>).ToList();

            ViewBag.NumTrendingGameDays = NUMBER_OF_DAYS_OF_TRENDING_GAMES;
            return(PartialView(MVC.GameDefinition.Views._TrendingGamesPartial, trendingGameViewModels));
        }
Exemplo n.º 4
0
        public virtual PartialViewResult GetTopGamesPartialView(int numberOfGamesToShow, int numberOfDaysToConsider)
        {
            var trendingGamesRequest   = new TrendingGamesRequest(numberOfGamesToShow, numberOfDaysToConsider);
            var trendingGames          = _trendingGamesRetriever.GetResults(trendingGamesRequest);
            var trendingGameViewModels = trendingGames.Select(_transformer.Transform <TrendingGameViewModel>).ToList();

            ViewBag.NumTrendingGameDays = NUMBER_OF_DAYS_OF_TRENDING_GAMES;
            return(PartialView(MVC.GameDefinition.Views._TrendingGamesPartial, trendingGameViewModels));
        }