Example #1
0
        public async Task <GameModel.CreateGame.Models.OutModel> CreateGame([FromBody] GameModel.CreateGame.Models.InModel inModel)
        {
            GameModel.CreateGame.Models.OutModel outModel = new GameModel.CreateGame.Models.OutModel();
            outModel.IdGame = await gameService.CreateGame(inModel.IdCreatedUser, inModel.Title, inModel.Size);

            return(outModel);
        }
Example #2
0
        public void Create(string name, string description, string coverIMG, decimal price, string publisher, int year, int month, int day)
        {
            Game newGame = new Game()
            {
                Name = name, Description = description, CoverImgPath = coverIMG, Price = price, Publisher = publisher, ReleaseDate = new DateTime(year, month, day)
            };

            _services.CreateGame(newGame);
        }
Example #3
0
        public ActionResult New(PlayerType playerType)
        {
            var gameKey = _gameService.CreateGame();

            return(RedirectToAction(playerType == PlayerType.SpyMaster ? "SpyMaster" : "Agent", new { key = gameKey }));
        }