コード例 #1
0
ファイル: Battleship.cs プロジェクト: SinghRaj/Battleship
        IBoard InitialiseBoard(string player, int shipLength)
        {
            Console.WriteLine($"Initialising board for {player}....");
            IBoard board = new Board(player);

            Console.WriteLine($"Initialsed 8x8 grid board for {player}");
            //board.PrintMatrix();

            IShip ship = new Ship(player, shipLength, _coordinatesReader, _console);

            ship.InitilizeShip();

            board.AddShipToMatrix(ship);
            board.UpdateMatrix(ship.CoordinatesList, Enums.CoordinateStatus.Ship);
            Console.WriteLine($"Added ship on board for {player}");
            board.PrintMatrix();

            return(board);
        }