Ejemplo n.º 1
0
        public static MazeBuilder Generate(int width, int height, MazeConfig config = null)
        {
            var mazeBuilder = new MazeBuilder(width, height, config ?? new MazeConfig());

            mazeBuilder.Build();
            return(mazeBuilder);
        }
Ejemplo n.º 2
0
 private MazeBuilder(int width, int height, MazeConfig config)
 {
     Config = config;
     Width  = width;
     Height = height;
     Config.MaxRoomWidth  = Math.Min(width, Config.MaxRoomWidth);
     Config.MaxRoomHeight = Math.Min(height, Config.MaxRoomHeight);
     Map = new CellType[Width, Height];
 }