コード例 #1
0
 public void ShowBoardState(Sokoban.Domain.Maze maze)
 {
     Console.Clear();
     Console.WriteLine("┌──────────┐   ");
     Console.WriteLine("| Sokoban  |   ");
     Console.WriteLine("└──────────┘   ");
     Console.WriteLine("─────────────────────────────────────────────────────────────────────────");
     Show(maze);
     Console.WriteLine("─────────────────────────────────────────────────────────────────────────");
 }
コード例 #2
0
        private void Show(Sokoban.Domain.Maze mazeModel)
        {
            int nRows = mazeModel.Height;
            int nCols = mazeModel.Width;

            for (int r = 0; r < nRows; r++)
            {
                for (int c = 0; c < nCols; c++)
                {
                    Console.Write(_viewController.DrawFieldAt(c, r));
                }
                Console.WriteLine();
            }
        }
コード例 #3
0
        private void Show(Sokoban.Domain.Maze mazeModel)
        {
            int nRows = mazeModel.Height;
            int nCols = mazeModel.Width;

            BaseField current        = mazeModel.Origin;
            BaseField neighbourBelow = current.FieldBelow;

            for (int r = 0; r < nRows; r++)
            {
                for (int c = 0; c < nCols; c++)
                {
                    Console.Write(current.ToChar());
                    current = current.FieldToRight;
                }
                current = neighbourBelow;
                if (neighbourBelow != null)
                {
                    neighbourBelow = current.FieldBelow;
                }
                Console.WriteLine();
            }
        }