コード例 #1
0
        public Statistics_GameStats()
        {
            InitializeComponent();

            _vm = new GameStatsViewModel();
            this.DataContext = _vm;
        }
コード例 #2
0
        public IActionResult GameStats()
        {
            ViewBag.Title = "Game Stats";

            var model = new GameStatsViewModel
            {
                Global = new GameStatsModel
                {
                    TopDevelopers = _gameStatisticService.TopDevelopers(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    TopPublishers = _gameStatisticService.TopPublishers(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    Types         = new GameTypesModel
                    {
                        NumFullGame  = _gameStatisticService.NumFullGame(),
                        NumDLC       = _gameStatisticService.NumDLC(),
                        NumExpansion = _gameStatisticService.NumExpansion(),
                        Title        = "Global Game Types",
                        ID           = "global-game-types"
                    },
                    Ratings = new GameRatingModel
                    {
                        NumRatedEC  = _gameStatisticService.NumRatedEC(),
                        NumRatedE   = _gameStatisticService.NumRatedE(),
                        NumRatedE10 = _gameStatisticService.NumRatedE10(),
                        NumRatedT   = _gameStatisticService.NumRatedT(),
                        NumRatedM   = _gameStatisticService.NumRatedM(),
                        NumRatedA   = _gameStatisticService.NumRatedA(),
                        Title       = "Global Game Ratings",
                        ID          = "global-game-ratings"
                    },
                    Platforms = new GamePlatformsModel
                    {
                        CurrentGeneration = new CurrentGeneration
                        {
                            NumPlayStation4   = _gameStatisticService.NumPlayStation4(),
                            NumXboxOne        = _gameStatisticService.NumXboxOne(),
                            NumNintendoSwitch = _gameStatisticService.NumNintendoSwitch(),
                            Title             = "Global Current Generation",
                            ID = "global-current-generation"
                        },
                        Other = new OtherPlatforms
                        {
                            NumBoardGame = _gameStatisticService.NumBoardGame(),
                            NumPC        = _gameStatisticService.NumPC(),
                            Title        = "Global Other",
                            ID           = "global-other"
                        },
                        Sony = new Sony
                        {
                            NumPlayStation  = _gameStatisticService.NumPlayStation(),
                            NumPlayStation2 = _gameStatisticService.NumPlayStation2(),
                            NumPlayStation3 = _gameStatisticService.NumPlayStation3(),
                            NumPlayStation4 = _gameStatisticService.NumPlayStation4(),
                            NumPSP          = _gameStatisticService.NumPSP(),
                            NumPSVita       = _gameStatisticService.NumPSVita(),
                            Title           = "Global Sony",
                            ID = "global-sony"
                        },
                        Microsoft = new Models.Microsoft
                        {
                            NumXbox    = _gameStatisticService.NumXbox(),
                            NumXbox360 = _gameStatisticService.NumXbox360(),
                            NumXboxOne = _gameStatisticService.NumXboxOne(),
                            Title      = "Global Microsoft",
                            ID         = "global-microsoft"
                        },
                        Nintendo = new Nintendo
                        {
                            NumNintendo64     = _gameStatisticService.NumNintendo64(),
                            NumGameCube       = _gameStatisticService.NumGameCube(),
                            NumWii            = _gameStatisticService.NumWii(),
                            NumWiiU           = _gameStatisticService.NumWiiU(),
                            NumNintendoSwitch = _gameStatisticService.NumNintendoSwitch(),
                            NumGameBoy        = _gameStatisticService.NumGameBoy(),
                            NumGameBoyAdvance = _gameStatisticService.NumGameBoyAdvance(),
                            NumNintendoDS     = _gameStatisticService.NumNintendoDS(),
                            NumNintendo3DS    = _gameStatisticService.NumNintendo3DS(),
                            Title             = "Global Nintendo",
                            ID = "global-nintendo"
                        },
                        Handhelds = new Handhelds
                        {
                            NumGameBoy        = _gameStatisticService.NumGameBoy(),
                            NumGameBoyAdvance = _gameStatisticService.NumGameBoyAdvance(),
                            NumNintendoDS     = _gameStatisticService.NumNintendoDS(),
                            NumNintendo3DS    = _gameStatisticService.NumNintendo3DS(),
                            NumPSP            = _gameStatisticService.NumPSP(),
                            NumPSVita         = _gameStatisticService.NumPSVita(),
                            NumSwitch         = _gameStatisticService.NumNintendoSwitch(),
                            Title             = "Global Handhelds",
                            ID = "global-handhelds"
                        }
                    },
                    TopCountriesOfOrigin  = _gameStatisticService.TopCountriesOfOrigin(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    TopPurchaseCountries  = _gameStatisticService.TopPurchaseCountries(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    MostCompleted         = _gameStatisticService.MostCompleted(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    TopLocationsPurchased = _gameStatisticService.TopLocationsPurchased(numToTake: NUM_OF_TOP_TO_TAKE).ToList(),
                    TopReleaseYears       = _gameStatisticService.TopReleaseYears(numToTake: NUM_OF_TOP_TO_TAKE).ToList()
                },
                User = new GameStatsModel
                {
                    TopDevelopers = _gameStatisticService.TopDevelopers(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    TopPublishers = _gameStatisticService.TopPublishers(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    Types         = new GameTypesModel
                    {
                        NumFullGame  = _gameStatisticService.NumFullGame(_user.Id),
                        NumDLC       = _gameStatisticService.NumDLC(_user.Id),
                        NumExpansion = _gameStatisticService.NumExpansion(_user.Id),
                        Title        = "User Game Types",
                        ID           = "user-game-types"
                    },
                    Ratings = new GameRatingModel
                    {
                        NumRatedEC  = _gameStatisticService.NumRatedEC(_user.Id),
                        NumRatedE   = _gameStatisticService.NumRatedE(_user.Id),
                        NumRatedE10 = _gameStatisticService.NumRatedE10(_user.Id),
                        NumRatedT   = _gameStatisticService.NumRatedT(_user.Id),
                        NumRatedM   = _gameStatisticService.NumRatedM(_user.Id),
                        NumRatedA   = _gameStatisticService.NumRatedA(_user.Id),
                        Title       = "User Game Ratings",
                        ID          = "user-game-ratings"
                    },
                    Platforms = new GamePlatformsModel
                    {
                        CurrentGeneration = new CurrentGeneration
                        {
                            NumPlayStation4   = _gameStatisticService.NumPlayStation4(_user.Id),
                            NumXboxOne        = _gameStatisticService.NumXboxOne(_user.Id),
                            NumNintendoSwitch = _gameStatisticService.NumNintendoSwitch(_user.Id),
                            Title             = "User Current Generation",
                            ID = "user-current-generation"
                        },
                        Other = new OtherPlatforms
                        {
                            NumBoardGame = _gameStatisticService.NumBoardGame(_user.Id),
                            NumPC        = _gameStatisticService.NumPC(_user.Id),
                            Title        = "User Other",
                            ID           = "user-other"
                        },
                        Sony = new Sony
                        {
                            NumPlayStation  = _gameStatisticService.NumPlayStation(_user.Id),
                            NumPlayStation2 = _gameStatisticService.NumPlayStation2(_user.Id),
                            NumPlayStation3 = _gameStatisticService.NumPlayStation3(_user.Id),
                            NumPlayStation4 = _gameStatisticService.NumPlayStation4(_user.Id),
                            NumPSP          = _gameStatisticService.NumPSP(_user.Id),
                            NumPSVita       = _gameStatisticService.NumPSVita(_user.Id),
                            Title           = "User Sony",
                            ID = "user-sony"
                        },
                        Microsoft = new Models.Microsoft
                        {
                            NumXbox    = _gameStatisticService.NumXbox(_user.Id),
                            NumXbox360 = _gameStatisticService.NumXbox360(_user.Id),
                            NumXboxOne = _gameStatisticService.NumXboxOne(_user.Id),
                            Title      = "User Microsoft",
                            ID         = "user-microsoft"
                        },
                        Nintendo = new Nintendo
                        {
                            NumNintendo64     = _gameStatisticService.NumNintendo64(_user.Id),
                            NumGameCube       = _gameStatisticService.NumGameCube(_user.Id),
                            NumWii            = _gameStatisticService.NumWii(_user.Id),
                            NumWiiU           = _gameStatisticService.NumWiiU(_user.Id),
                            NumNintendoSwitch = _gameStatisticService.NumNintendoSwitch(_user.Id),
                            NumGameBoy        = _gameStatisticService.NumGameBoy(_user.Id),
                            NumGameBoyAdvance = _gameStatisticService.NumGameBoyAdvance(_user.Id),
                            NumNintendoDS     = _gameStatisticService.NumNintendoDS(_user.Id),
                            NumNintendo3DS    = _gameStatisticService.NumNintendo3DS(_user.Id),
                            Title             = "User Nintendo",
                            ID = "user-nintendo"
                        },
                        Handhelds = new Handhelds
                        {
                            NumGameBoy        = _gameStatisticService.NumGameBoy(_user.Id),
                            NumGameBoyAdvance = _gameStatisticService.NumGameBoyAdvance(_user.Id),
                            NumNintendoDS     = _gameStatisticService.NumNintendoDS(_user.Id),
                            NumNintendo3DS    = _gameStatisticService.NumNintendo3DS(_user.Id),
                            NumPSP            = _gameStatisticService.NumPSP(_user.Id),
                            NumPSVita         = _gameStatisticService.NumPSVita(_user.Id),
                            Title             = "User Handhelds",
                            ID = "user-handhelds"
                        }
                    },
                    TopCountriesOfOrigin  = _gameStatisticService.TopCountriesOfOrigin(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    TopPurchaseCountries  = _gameStatisticService.TopPurchaseCountries(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    MostCompleted         = _gameStatisticService.MostCompleted(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    TopLocationsPurchased = _gameStatisticService.TopLocationsPurchased(_user.Id, NUM_OF_TOP_TO_TAKE).ToList(),
                    TopReleaseYears       = _gameStatisticService.TopReleaseYears(_user.Id, NUM_OF_TOP_TO_TAKE).ToList()
                }
            };

            return(View(model));
        }