private void HandleMissedShot(Shot shot) { SetField(boardStateFields, shot.Position, new MissedShotField(shot.Position)); SetField(playerFields, shot.Position, new MissedShotField(shot.Position)); MissedShot?.Invoke(this, new MissedShotEventArgs(new ReadOnlyBoardContext(this))); }
public void MakeShot(int rowIndex, int columnIndex) { var usedGridPoint = _grid.UsedGridPoints.FirstOrDefault(point => point.X == rowIndex && point.Y == columnIndex); if (usedGridPoint != null) { usedGridPoint.HitGridPoint(); CheckShot(rowIndex, columnIndex); } else { MissedShot?.Invoke(this, new EventArgs()); } }