private char GetFieldStatus(BoardField boardField) { if (boardField.HasShip) { if (boardField.Status == BoardField.State.ShotDown) { return(_shipStatus[boardField.GetShip().Status]); } else { return(_fieldStatus[boardField.Status]); } } else { return(_fieldStatus[boardField.Status]); } }
private Shot.Result Shoot(ShotConfig shotConfig) { BoardField targetField = _board.GetField(shotConfig.RowNumber, shotConfig.ColumnNumber); Shot.Result shotResult = targetField.Shoot(); if (shotResult == Shot.Result.Destroyed) { _board.DecreaseShipsNumber(); } _statistics.IncreaseShots(); if (shotResult != Shot.Result.Missed) { _statistics.IncreaseShotsOnTarget(); } return(shotResult); }