Exemple #1
0
        public MazeTileRow Next()
        {
            MazeTileType[] rowTiles = GenerateTilesRow(out var pathTiles);
            LastRowTiles = rowTiles;

            var mazeRow = new MazeTileRow(TilesInRow);

            mazeRow.FillWallData(rowTiles);

            mazeRow.FillPathData(pathTiles);

            return(mazeRow);
        }
        internal void Display(MazeTileRow mazePart)
        {
            Console.SetCursorPosition(Console.CursorLeft, Console.CursorTop - 1);
            Console.Write('\r');
            for (int i = 0; i < mazePart.Height; i++)
            {
                for (int j = 0; j < mazePart.Width; j++)
                {
                    WriteBlock(mazePart.IsWallAt(j, i));
                    if (mazePart.IsPathAt(j, i))
                    {
                        WritePath(true);
                    }
                }

                for (int j = mazePart.Width - 1; j >= 0; j--)
                {
                    WriteBlock(mazePart.IsWallAt(j, i));
                }
                Console.WriteLine();
            }
        }