Exemplo n.º 1
0
        public Entity Gen(EntityGenerationInfo info)
        {
            var tag = BasePropabilities.GetRand(info.Rnd);

            var e = GetBasic(tag);

            return(e);
        }
Exemplo n.º 2
0
        public static VoronoiNoise <T> Make(Size rect, int scale, Random rnd, RandomTable <T> elems)
        {
            var cells   = new Grid <T>(new Size((int)Math.Ceiling(rect.X / (double)scale), (int)Math.Ceiling(rect.Y / (double)scale)));
            var centers = new Grid <Vec>(cells.Size);

            foreach (var i in cells.Ids())
            {
                cells[i]   = elems.GetRand(rnd);
                centers[i] = new Vec(i.X * scale + rnd.Next(scale), i.Y * scale + rnd.Next(scale));
            }

            return(new VoronoiNoise <T> {
                Scale = scale,
                Cells = cells,
                Centers = centers
            });
        }