示例#1
0
        public static void DisplayBoard(ref bool[,] isAWall, Unit[] tanks, Bullet[] bullets, ConsoleColor foregroundColor = ConsoleColor.White)
        {
            ConsoleColor oldFGColor = System.Console.ForegroundColor;

            System.Console.ForegroundColor = foregroundColor;
            try
            {
                string[] boardRows = BoardHelper.GenerateViewOfBoard(ref isAWall, tanks, bullets);
                foreach (string boardRow in boardRows)
                {
                    System.Console.WriteLine(boardRow);
                }
                System.Console.WriteLine();
            }
            finally
            {
                System.Console.ForegroundColor = oldFGColor;
            }
        }