create a bool Attack with two int variables from user for input. Also check if ship is sunken
public bool Attack(int x, int y) { if (Sunken) throw new InvalidOperationException("Ship is destroyed."); if (x < 0 || x >= Board.Width || y < 0 || y >= Board.Height) throw new InvalidOperationException("Attack was out of range."); if (Board.AttackBoard[x, y] == Board.CellState.Hit) throw new InvalidOperationException("You've already attacked this position."); Board.AttackBoard[x, y] = Board.CellState.Hit; if (Board.GetShipAt(x, y) == null) return false; if (Board.GetShipAt(x, y).IsDestroyed()) { Sunken = true; return true; } return true; }