Exemple #1
0
        public override void PlantTree(IPlanet planet, Index3 index, LocalBuilder builder, int seed)
        {
            ushort ground = builder.GetBlock(0, 0, -1);

            if (ground == water)
            {
                return;
            }

            Random rand   = new Random(seed);
            int    height = rand.Next(2, 4);

            var infos = new BlockInfo[height];

            for (int i = 0; i < height; i++)
            {
                infos[i] = (0, 0, i, cactus);
            }
            builder.SetBlocks(false, infos);
        }
Exemple #2
0
        public override void PlantTree(IPlanet planet, Index3 index, LocalBuilder builder, int seed)
        {
            ushort ground = builder.GetBlock(0, 0, -1);

            if (ground == water)
            {
                return;
            }

            Random rand   = new Random(seed);
            int    height = rand.Next(6, 10);
            int    radius = rand.Next(3, height - 2);

            builder.FillSphere(0, 0, height, radius, leave);

            var infos = new BlockInfo[height + 2];

            for (int i = 0; i < height + 2; i++)
            {
                infos[i] = (0, 0, i, wood);
            }
            builder.SetBlocks(false, infos);
        }