Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void ExecuteShipPlacement(string direction, int[] startCoords, ShipTypes ship)
- {
- if(direction == "w")
- {
- int temp = 0;
- for (int i = startCoords[0]; i >= 0; i--)
- {
- if (Board[i, startCoords[1]] == CellStatus.DECK)
- throw new System.NotImplementedException();
- Board[i, startCoords[1]] = CellStatus.DECK;
- temp++;
- if (temp == (int)ship)
- break;
- }
- }
- if (direction == "s")
- {
- int temp = 0;
- for (int i = startCoords[0]; i <= 9; i++)
- {
- if (Board[i, startCoords[1]] == CellStatus.DECK)
- throw new System.NotImplementedException();
- Board[i, startCoords[1]] = CellStatus.DECK;
- temp++;
- if (temp == (int)ship)
- break;
- }
- }
- if (direction == "d")
- {
- int temp = 0;
- for (int i = startCoords[1]; i <= 9; i++)
- {
- if (Board[startCoords[0], i] == CellStatus.DECK)
- throw new System.NotImplementedException();
- Board[startCoords[0], i] = CellStatus.DECK;
- temp++;
- if (temp == (int)ship)
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement