public void PlaceShip(Vector space, bool horizontal) { if (ShipSelected == EnumShipList.None) { throw new BasicBlankException("Must have a ship selected in order to place the ship"); } var thisShip = ShipList[(int)ShipSelected]; thisShip.Visible = false; foreach (var thisPiece in thisShip.PieceList !.Values) { int nextShip = thisPiece.Index; _gameBoard1.PlaceShip(space, nextShip, out string Info); thisPiece.Location = Info; if (horizontal == true) { space.Column++; } else { space.Row++; } } ShipSelected = EnumShipList.None; }
public void ClearBoard() { ShipSelected = EnumShipList.None; foreach (var thisShip in ShipList.Values) { thisShip.Visible = true; foreach (var ThisPiece in thisShip.PieceList !.Values) { ThisPiece.DidHit = false; ThisPiece.Location = ""; } } }
public void ChooseShip(EnumShipList ship) { _viewModel.ShipSelected = ship; //looks like has to be put to that model which will notify this as well. _mainGame.GameBoard1.HumanWaiting(); }