public LayerAutoVoronoiMixdown()
     : base()
 {
     this.Perlin       = new LayerInitialPerlin();
     this.Voronoi      = new LayerInitialVoronoi();
     this.Mixdown      = new LayerVoronoiMixdown(this.Voronoi, this.Perlin);
     this.Perlin.Seed  = this.Seed;
     this.Voronoi.Seed = this.Seed;
 }
        public override Dictionary <int, LayerColor> GetLayerColors()
        {
            // If we are deserialized, our Perlin / Voronoi might not be created
            // so we need to recreate them.
            if (this.Perlin == null)
            {
                this.Perlin      = new LayerInitialPerlin();
                this.Perlin.Seed = this.Seed;
            }
            if (this.Voronoi == null)
            {
                this.Voronoi      = new LayerInitialVoronoi();
                this.Voronoi.Seed = this.Seed;
            }
            if (this.Mixdown == null)
            {
                this.Mixdown = new LayerVoronoiMixdown(this.Voronoi, this.Perlin);
            }

            return(this.Mixdown.GetLayerColors());
        }
        protected override int[] GenerateDataImpl(long x, long y, long width, long height)
        {
            // If we are deserialized, our Perlin / Voronoi might not be created
            // so we need to recreate them.
            if (this.Perlin == null)
            {
                this.Perlin      = new LayerInitialPerlin();
                this.Perlin.Seed = this.Seed;
            }
            if (this.Voronoi == null)
            {
                this.Voronoi      = new LayerInitialVoronoi();
                this.Voronoi.Seed = this.Seed;
            }
            if (this.Mixdown == null)
            {
                this.Mixdown = new LayerVoronoiMixdown(this.Voronoi, this.Perlin);
            }

            return(this.Mixdown.GenerateData(x, y, width, height));
        }