public Tuple<bool, bool, Ship> Hit(BoardPosition position) { return Hit(position.X, position.Y); }
public Tuple<bool, bool, Ship> Hit(int x, int y) { var position = new BoardPosition(x, y); foreach (var wrapper in shipWrappers) { if(wrapper.Ship.IsSunk) { continue; } if (!wrapper.Positions.Contains(position)) { continue; } return new Tuple<bool, bool, Ship>(true, wrapper.Hit(position), wrapper.Ship); } return new Tuple<bool, bool, Ship>(false, false, null); }
Button hpButton(BoardPosition position) { foreach (var control in Controls) { if (control is Button) { var button = control as Button; if (button.Name == hp_btn_Name(position.X, position.Y)) { return button; } } } return null; }