/// <inheritdoc/> public long NewGame(BoringToeNewGameRequest request) { Player playerA = FindPlayerInDatabase(request.PlayerAId, ErrorCode.PLAYER_A_NOT_EXISTING); Player playerB = FindPlayerInDatabase(request.PlayerBId, ErrorCode.PLAYER_B_NOT_EXISTING); ITicTacToe game = new TicTacToeImpl(); IGrid grid = new Grid(); game.StartGame(grid, playerA, playerB); return(_boringToeRepository.AddGame((TicTacToeImpl)game)); }
public ActionResult Post([FromBody] BoringToeNewGameRequest request) { long resp = _boringToeService.NewGame(request); return(Created("api/v1/BoringToe/" + resp, resp)); }