static public void Introduction(Board board) { Console.Clear(); Console.WriteLine(" *********START*********\n"); PrintObject.Board(board.Matrix); Console.WriteLine("\nYou have finished setting up the game!\n" + "Now choose a point from the enemy board to attack\n"); }
public void LocateSubmarinesOnBoard(Player player) { bool IsSuccess = true; string message = null; SetGame.SetUp(); for (int i = 0; i < player.Submarines.Length; i++) { do { if (!IsSuccess) { message = "Error Placing the submarine, try another points"; } Point[] points = SetGame.GetSubmarineEdgePoints(player.Submarines[i], player.MyBoard.Matrix, message); PlaceSubmarine placeTool = new PlaceSubmarine(ref player.Submarines[i], points[0], points[1], PlayerA.MyBoard); IsSuccess = placeTool.IsPlaced(); } while (!IsSuccess); } PrintObject.Board(PlayerA.MyBoard.Matrix); }
public static Point[] GetSubmarineEdgePoints(Submarine submarine, Square[,] matrix, string message = null) { Point[] endPoints = new Point[2]; Console.WriteLine(message + "\n"); Console.WriteLine("Place the following Submarine:\t"); PrintObject.Submarine(submarine.Size); PrintObject.Board(matrix); for (int i = 0; i < 2; i++) { endPoints[i] = new Point(); InputPoint.GetPoint(ref endPoints[i]); if (endPoints[0] == endPoints[1] && endPoints[0] != null) { Console.WriteLine("Choose 2 different points from each other"); i = 0; } } return(endPoints); }
public static void Introduction(Player player) { Console.WriteLine("Welcome to the Submarine Game! this is your board, and your submarine Territory.\n"); PrintObject.Board(player.MyBoard.Matrix); }