// Generate and populate the forest
        public override void Generate(Chunk chunkToPopulate)
        {
            // Set the constants
            name = "grassland";
            normalTemperature = 60;
            normalWindSpeed   = 30;
            associatedColor   = "$ka";
            // Create a new random generator
            Random random = new Random();

            // Generate the chunks properties
            chunkToPopulate.windSpeed   = (normalWindSpeed * (random.Next(2, 8) / 5));
            chunkToPopulate.temperature = (normalTemperature * (random.Next(2, 4) / 3));

            if (random.Next(0, 5) == 0)
            {
                Creatures.CreatureGoat newGoat = new Creatures.CreatureGoat(chunkToPopulate.attachedApplication);
                newGoat.identifier.descriptiveAdjectives.Add("fat");
                newGoat.identifier.descriptiveAdjectives.Add("wild");
                chunkToPopulate.AddChild(newGoat);
            }

            #region Add plants
            // the amont of Tall Fescues
            int amontOfTallFescues = random.Next(100, 200);

            for (int i = 0; i < amontOfTallFescues; i++)
            {
                // Create a new Tall Fescue
                Plants.PlantTallFescue newTallFescue = new Plants.PlantTallFescue();
                newTallFescue.identifier.name = "grass";
                newTallFescue.identifier.descriptiveAdjectives.Add("lush");
                newTallFescue.identifier.descriptiveAdjectives.Add("tall");
                newTallFescue.identifier.classifierAdjectives.Add("fescue");
                chunkToPopulate.AddChild(newTallFescue);
            }

            // the amont of CrabGrass
            int amontOfCrabGrass = random.Next(10, 50);

            for (int i = 0; i < amontOfCrabGrass; i++)
            {
                // Create a new CrabGrass
                Plants.PlantCrabGrass newCrabGrass = new Plants.PlantCrabGrass();
                newCrabGrass.identifier.name = "grass";
                newCrabGrass.identifier.classifierAdjectives.Add("crab");
                chunkToPopulate.AddChild(newCrabGrass);
            }
            #endregion
        }
        // Generate and populate the forest
        public override void Generate(Chunk chunkToPopulate)
        {
            // Set the constants
            name = "savanna";
            normalTemperature = 85;
            normalWindSpeed   = 10;
            associatedColor   = "$ga";
            // Create a new random generator
            Random random = new Random();

            // Generate the chunks properties
            chunkToPopulate.windSpeed   = (normalWindSpeed * (random.Next(2, 8) / 5));
            chunkToPopulate.temperature = (normalTemperature * (random.Next(2, 4) / 3));

            if (random.Next(0, 5) == 0)
            {
                Creatures.CreatureGoat newGoat = new Creatures.CreatureGoat(chunkToPopulate.attachedApplication);
                newGoat.identifier.descriptiveAdjectives.Add("wild");
                newGoat.identifier.classifierAdjectives.Add("bearded");
                chunkToPopulate.AddChild(newGoat);
            }

            #region Add plants
            // the amont of Tall Fescues
            int amontOfTallFescues = random.Next(100, 200);

            for (int i = 0; i < amontOfTallFescues; i++)
            {
                // Create a new Tall Fescue
                Plants.PlantTallFescue newTallFescue = new Plants.PlantTallFescue();
                newTallFescue.identifier.name = "grass";
                newTallFescue.identifier.descriptiveAdjectives.Add("lush");
                newTallFescue.identifier.descriptiveAdjectives.Add("tall");
                newTallFescue.identifier.classifierAdjectives.Add("fescue");
                chunkToPopulate.AddChild(newTallFescue);
            }

            // the amont of acacia trees
            int amontOfAcaciaTrees = random.Next(1, 5);

            for (int i = 0; i < amontOfAcaciaTrees; i++)
            {
                // Create a new Acacia Trees
                Plants.PlantAcaciaTree newAcaciaTree = new Plants.PlantAcaciaTree();
                newAcaciaTree.identifier.name = "tree";

                // Make it eather short or tall
                if (random.Next(0, 1) == 0)
                {
                    newAcaciaTree.identifier.descriptiveAdjectives.Add("short");
                }
                else
                {
                    newAcaciaTree.identifier.descriptiveAdjectives.Add("tall");
                }

                newAcaciaTree.identifier.classifierAdjectives.Add("acacia");
                chunkToPopulate.AddChild(newAcaciaTree);
            }
            // the amont of acacia Branches
            int amontOfAcaciaBranches = random.Next(1, 3);

            for (int i = 0; i < amontOfAcaciaBranches; i++)
            {
                // Create a new acacia Branches
                Plants.PlantParts.PlantPartAcaciaTree.PlantPartAcaciaTreeBranch newAcaciaBranch = new Plants.PlantParts.PlantPartAcaciaTree.PlantPartAcaciaTreeBranch();
                newAcaciaBranch.identifier.name = "branch";

                // Make it eather long or short
                if (random.Next(0, 1) == 0)
                {
                    newAcaciaBranch.identifier.descriptiveAdjectives.Add("long");
                    newAcaciaBranch.specialProperties["weight"] = random.Next(5, 10).ToString();
                }
                else
                {
                    newAcaciaBranch.identifier.descriptiveAdjectives.Add("short");
                    newAcaciaBranch.specialProperties["weight"] = random.Next(2, 5).ToString();
                }


                newAcaciaBranch.identifier.classifierAdjectives.Add("acacia");
                chunkToPopulate.AddChild(newAcaciaBranch);
            }
            #endregion

            #region Add minerals
            // Decide whether to generate copper
            if (random.Next(1, 5) == 1)
            {
                // the amont of copper
                int amontOfCopper = random.Next(1, 2);

                for (int i = 0; i < amontOfCopper; i++)
                {
                    // Create a new piece of copper
                    Minerals.MineralCopper newCopper = new Minerals.MineralCopper();
                    chunkToPopulate.AddChild(newCopper);
                }
            }

            // Decide whether to generate rocks
            //if (random.Next(1, 5) == 1)
            {
                // the amont of rocks
                int amontOfRocks = random.Next(1, 3);

                for (int i = 0; i < amontOfRocks; i++)
                {
                    // Create a new piece of rock
                    Minerals.MineralBasaltRock newRock = new Minerals.MineralBasaltRock();
                    chunkToPopulate.AddChild(newRock);
                }
            }

            // Decide whether to generate salt
            if (random.Next(1, 5) == 1)
            {
                // the amont of salt
                int amontOfSalt = random.Next(1, 5);

                for (int i = 0; i < amontOfSalt; i++)
                {
                    // Create a new piece of salt
                    Minerals.MineralSalt newSalt = new Minerals.MineralSalt();
                    chunkToPopulate.AddChild(newSalt);
                }
            }
            #endregion
        }
        // Generate and populate the forest
        public override void Generate(Chunk chunkToPopulate)
        {
            // Set the constants
            name = "bog";
            normalTemperature = 30;
            normalWindSpeed   = 15;
            associatedColor   = "$ga";
            // Create a new random generator
            Random random = new Random();

            // Generate the chunks properties
            chunkToPopulate.windSpeed   = (normalWindSpeed * (random.Next(2, 8) / 5));
            chunkToPopulate.temperature = (normalTemperature * (random.Next(2, 4) / 3));

            #region Add plants
            // the amont of Tall Fescues
            int amontOfTallFescues = random.Next(50, 100);

            for (int i = 0; i < amontOfTallFescues; i++)
            {
                // Create a new Tall Fescue
                Plants.PlantTallFescue newTallFescue = new Plants.PlantTallFescue();
                newTallFescue.identifier.name = "grass";
                newTallFescue.identifier.descriptiveAdjectives.Add("lush");
                newTallFescue.identifier.descriptiveAdjectives.Add("tall");
                newTallFescue.identifier.classifierAdjectives.Add("fescue");
                chunkToPopulate.AddChild(newTallFescue);
            }

            // Decide whether to generate cattails
            if (random.Next(1, 3) == 1)
            {
                // the amont of cattails
                int amontOfCattails = random.Next(15, 30);

                for (int i = 0; i < amontOfCattails; i++)
                {
                    // Create a new Cattail
                    Plants.PlantCattail newCattail = new Plants.PlantCattail();
                    newCattail.identifier.name = "cattail";
                    chunkToPopulate.AddChild(newCattail);
                }
            }

            // Decide whether to generate reeds
            if (random.Next(1, 3) == 1)
            {
                // the amont of reeds
                int amontOfReeds = random.Next(15, 30);

                for (int i = 0; i < amontOfReeds; i++)
                {
                    // Create a new reed
                    Plants.PlantReed newReed = new Plants.PlantReed();
                    newReed.identifier.name = "reed";
                    chunkToPopulate.AddChild(newReed);
                }
            }
            #endregion

            #region Add minerals
            // the amont of Silt
            int amontOfSilt = random.Next(20, 50);

            for (int i = 0; i < amontOfSilt; i++)
            {
                // Create a new thing of silt
                Minerals.MineralSilt newSilt = new Minerals.MineralSilt();
                newSilt.identifier.name = "silt";
                chunkToPopulate.AddChild(newSilt);
            }
            #endregion
        }
예제 #4
0
        // Generate and populate the forest
        public override void Generate(Chunk chunkToPopulate)
        {
            // Set the constants
            name = "forest";
            normalTemperature = 50;
            normalWindSpeed   = 12;
            associatedColor   = "$ca";
            // Create a new random generator
            Random random = new Random();

            // Generate the chunks properties
            chunkToPopulate.windSpeed   = (normalWindSpeed * (random.Next(2, 8) / 5));
            chunkToPopulate.temperature = (normalTemperature * (random.Next(2, 4) / 3));

            if (random.Next(0, 10) == 0)
            {
                Creatures.CreatureBoar newBoar = new Creatures.CreatureBoar(chunkToPopulate.attachedApplication);
                newBoar.identifier.descriptiveAdjectives.Add("giant");
                newBoar.identifier.descriptiveAdjectives.Add("menacing");
                chunkToPopulate.AddChild(newBoar);
            }
            #region Add minerals
            // The amount of earth
            int amontOfEarth = random.Next(100, 200);

            for (int i = 0; i < amontOfEarth; i++)
            {
                // Create a new piece of Earth
                Minerals.MineralEarth newEarth = new Minerals.MineralEarth();
                chunkToPopulate.AddChild(newEarth);
            }

            // Decide whether to generate boulder
            if (random.Next(1, 3) == 1)
            {
                // the amont of boulder
                int amontOfBoulders = random.Next(1, 2);

                for (int i = 0; i < amontOfBoulders; i++)
                {
                    // Create a new piece of boulder
                    Minerals.MineralBasaltBoulder newBoulder = new Minerals.MineralBasaltBoulder();
                    chunkToPopulate.AddChild(newBoulder);
                }
            }
            #endregion

            #region Add plants to biome
            // the amont of oak trees
            int amontOfOakTrees = random.Next(5, 20);

            for (int i = 0; i < amontOfOakTrees; i++)
            {
                // Create a new Oak Trees
                Plants.PlantOakTree newOakTree = new Plants.PlantOakTree();
                newOakTree.identifier.name = "tree";

                // Make it eather short or tall
                if (random.Next(0, 1) == 0)
                {
                    newOakTree.identifier.descriptiveAdjectives.Add("short");
                }
                else
                {
                    newOakTree.identifier.descriptiveAdjectives.Add("tall");
                }

                newOakTree.identifier.classifierAdjectives.Add("oak");
                chunkToPopulate.AddChild(newOakTree);
            }

            // Decide whether to generate ferns

            // the amont of ferns
            int amontOfFerns = random.Next(12, 24);

            for (int i = 0; i < amontOfFerns; i++)
            {
                // Create a new fern
                Plants.PlantFern newFern = new Plants.PlantFern();
                newFern.identifier.name = "fern";
                chunkToPopulate.AddChild(newFern);
            }

            // the amont of Tall Fescues
            int amontOfTallFescues = random.Next(100, 200);

            for (int i = 0; i < amontOfTallFescues; i++)
            {
                // Create a new Tall Fescue
                Plants.PlantTallFescue newTallFescue = new Plants.PlantTallFescue();
                newTallFescue.identifier.name = "grass";
                newTallFescue.identifier.descriptiveAdjectives.Add("tall");
                newTallFescue.identifier.classifierAdjectives.Add("fescue");
                chunkToPopulate.AddChild(newTallFescue);
            }

            // the amont of oak Branches
            int amontOfOakBranches = random.Next(1, 3);

            for (int i = 0; i < amontOfOakBranches; i++)
            {
                // Create a new Oak Branches
                Plants.PlantParts.PlantPartOakTree.PlantPartOakTreeBranch newOakBranch = new Plants.PlantParts.PlantPartOakTree.PlantPartOakTreeBranch();
                newOakBranch.identifier.name = "branch";

                // Make it eather short or long
                if (random.Next(0, 1) == 0)
                {
                    newOakBranch.identifier.descriptiveAdjectives.Add("short");
                }
                else
                {
                    newOakBranch.identifier.descriptiveAdjectives.Add("long");
                }

                newOakBranch.identifier.descriptiveAdjectives.Add("fallen");

                newOakBranch.identifier.classifierAdjectives.Add("oak");
                chunkToPopulate.AddChild(newOakBranch);
            }
            #endregion
        }