public ActionResult <ShotResult> TakeShot(ShotModel shotModel) { if (shotModel == null) { return(BadRequest()); } Coordinates coords; try { coords = _coordinatesParser.ParseCellCoords(shotModel.Coordinates, _game.Matrix.Size); } catch (BadCoordinatesException e) { return(BadRequest(e.ToString())); } if (_battleService.CheckCellIsAlive(coords)) { return(BadRequest($"Shot at coordinates: {coords.StringRepresentation} was taken earlier.")); } _statisticsService.IncrementShotsCount(); return(_battleService.TakeShot(coords)); }