コード例 #1
0
        public async Task<HttpResponseMessage> Post(long id)
        {
            var results = new GameMoveResultsModel();
            var player = ApplicationUser.GetCurrentPlayer(this.User);
            
            var game = await this.gameService.PerformComputerMoveAsync(id);
            var computerPlayer = game.GetOtherPlayer(player.ID);

            results.Add(computerPlayer, game);

            return Request.CreateResponse(HttpStatusCode.OK, results);
        }
コード例 #2
0
        public async Task<HttpResponseMessage> Post(GameMoveModel model)
        {
            var results = new GameMoveResultsModel();
            var player = ApplicationUser.GetCurrentPlayer(this.User);

            var point = new DomainModel.Point(model.MoveToX, model.MoveToY);
            var game = await this.gameService.PerformMoveAsync(model.GameID, player.ID, model.TokenID, point);

            results.Add(player, game);

            return Request.CreateResponse(HttpStatusCode.OK, results);
        }