예제 #1
0
        public GameState SetupPlayersBoard()
        {
            ConsoleOutput.DisplaySplash();
            string p1 = ConsoleInput.ValidateUserName(1);
            //string p2 = ConsoleInput.GetName(2);
            //skipping over instantiating the board for now
            Board  b1 = BuildBoard(p1);
            string p2 = ConsoleInput.ValidateUserName(2);

            Board     b2            = BuildBoard(p2);
            Player    player1       = new Player(p1, b1);
            Player    player2       = new Player(p2, b2);
            bool      isPlayer1Turn = DetermineWhoStarts();
            GameState game          = new GameState(player1, player2, isPlayer1Turn);

            return(game);
            //halt exectution
            //problem is that you can only return 1

            //string player1 = ConsoleInput.GetPlayer1Name();
            //string player2 = ConsoleInput.GetPlayer2Name();

            /*
             * // for now just have their input be their name, but later one make it so that it must include a string of letters.
             * Console.WriteLine("Welcome to Battleship! Player 1, please start by entering your name.");
             * player1 = Console.ReadLine();
             *
             * Console.WriteLine($"Welcome to Battleship {player1}, now player 2, please enter your name.");
             * player2 = Console.ReadLine();
             * Console.WriteLine($"Welcome to Battleship {player2}.");
             */
        }