public async Task <GameStatusDto> ApplyLifeFormAsync(CreateLifeformResourceObject createLifeformResourceObject) { GameStatusDto currentGameStatus = await _gamestatusService.GetGameStatusAsync(); GameStatusDto nextGameStatus = new GameStatusDto(currentGameStatus.Columns, currentGameStatus.Rows, _lifeformFactory.createLifeform(createLifeformResourceObject.Name.ToUpperInvariant(), createLifeformResourceObject.Color, createLifeformResourceObject.Col, createLifeformResourceObject.Row, currentGameStatus.Board) , currentGameStatus.Generation); await _gamestatusService.SetGameStatusAsync(nextGameStatus); return(nextGameStatus); }
public async Task <IActionResult> UpdateGameStatusAsync([FromBody] CreateLifeformResourceObject createLifeformResourceObject) { var result = await _gameEvolutionService.ApplyLifeFormAsync(createLifeformResourceObject); return(Ok(result)); }