Esempio n. 1
0
        /// <summary>
        /// Generate a TestTerrain
        /// </summary>
        /// <param name="x">Size X</param>
        /// <param name="y">Size Y</param>
        /// <returns>Completed GameMap</returns>
        public GameMap GenerateTestTerran(int x, int y)
        {
            LandMassGenerator lmg      = new LandMassGenerator();
            PointGroup        ocean    = lmg.GenerateOcean(x, y);
            PointGroup        LandMass = new PointGroup();
            PointGroup        IceCaps  = new PointGroup();
            PointGroup        Deserts  = new PointGroup();
            PointGroup        Swamp    = new PointGroup();
            MapConsolidator   mc       = new MapConsolidator();

            //***LandMass***
            //right side of planet
            LandMass.AddRange(lmg.GenerateContinent(x / 4, y / 4, 10, 20, 20));        //Canada region
            LandMass.AddRange(lmg.GenerateContinent(x / 2, y / 4, 4, 10, 10));         //Greenland Region
            LandMass.AddRange(lmg.GenerateContinent(x / 4, y / 3, 7, 20, 30));         //North America region
            LandMass.AddRange(lmg.GenerateContinent(x / 4, y / 2, 4, 10, 10));         //Centeral America Region
            LandMass.AddRange(lmg.GenerateContinent(x / 4, y * 3 / 4, 7, 20, 20));     //South America region
            //left side of planet
            LandMass.AddRange(lmg.GenerateContinent(x * 3 / 4, y / 4, 10, 20, 30));    //Siberia Region
            LandMass.AddRange(lmg.GenerateContinent(x * 2 / 3, y / 3, 4, 10, 10));     //Europe Region
            LandMass.AddRange(lmg.GenerateContinent(x * 2 / 3, y * 2 / 3, 7, 20, 20)); //Africa Region
            LandMass.AddRange(lmg.GenerateContinent(x * 3 / 4, y * 3 / 4, 3, 10, 10)); //Australia Region
            LandMass.AddRange(lmg.GenerateContinent(x * 7 / 8, y / 2, 7, 10, 10));     //Asian Region
            //South Pole
            LandMass.AddRange(lmg.GenerateContinent(x / 2, y, 3, 10, 10));             //South pole land
            IceCaps.AddRange(lmg.GenerateIceCaps(x, y));                               //Ice Caps
            //***LandMass SubRegions***
            //Deserts
            Deserts.AddRange(lmg.GenerateDesert(LandMass, 20, 10));
            Deserts.AddRange(lmg.GenerateDesert(LandMass, 20, 10));
            //Swamps
            Swamp.AddRange(lmg.GenerateSwamp(LandMass, 20, 10));
            Swamp.AddRange(lmg.GenerateSwamp(LandMass, 20, 10));

            LandMass = MapWrap(LandMass, x);
            LandMass = mc.ConsolidateGroupPoints(new List <PointGroup> {
                ocean, LandMass, Deserts, Swamp
            });

            LandMass.AddRange(IceCaps);
            return(ColorMap(LandMass, x, y));
            //return LandMass;
        }
Esempio n. 2
0
        public GameMap GenerateTerran()
        {
            PointGroup Land   = new PointGroup();
            PointGroup Desert = new PointGroup();
            PointGroup Swamp  = new PointGroup();
            PointGroup Ocean  = new PointGroup();

            LandMassGenerator lmg = new LandMassGenerator();
            MapConsolidator   mc  = new MapConsolidator();

            //Left Side of Planet
            DrawLandMassStartEvent?.Invoke(this, "Continents");
            Land.AddRange(lmg.GenerateContinent(SizeX / 4, SizeY / 4, MediumContinentPoints, MediumContinentSize, MediumContinentClusterPoints));         //North America
            Land.AddRange(lmg.GenerateContinent(SizeX / 4, SizeY / 2, SmallContinentPoints, SmallContinentSize, SmallContinentClusterPoints));            //Central America
            Land.AddRange(lmg.GenerateContinent(SizeX / 4, SizeY * 3 / 4, MediumContinentPoints, MediumContinentSize, MediumContinentClusterPoints));     //South America
            //Right Side of Planet
            Land.AddRange(lmg.GenerateContinent(SizeX * 7 / 8, SizeY / 4, HugeContinentPoints, HugeContinentSize, HugeContinentClusterPoints));           //Asia
            Land.AddRange(lmg.GenerateContinent(SizeX * 2 / 3, SizeY / 2, SmallContinentPoints, SmallContinentSize, SmallContinentClusterPoints));        //Europe
            Land.AddRange(lmg.GenerateContinent(SizeX * 2 / 3, SizeY * 3 / 4, MediumContinentPoints, MediumContinentSize, MediumContinentClusterPoints)); //Africa
            Land.AddRange(lmg.GenerateContinent(SizeX * 3 / 4, SizeY * 3 / 4, SmallContinentPoints, SmallContinentSize, SmallContinentClusterPoints));    //Oceania
            DrawLandMassFinishEvent?.Invoke(this, "Continents");
            //Deserts
            DrawLandMassStartEvent?.Invoke(this, "Desert");
            Desert.AddRange(lmg.GenerateDesert(Land, IslandPoints));
            Desert.AddRange(lmg.GenerateDesert(Land, IslandPoints));
            Desert.AddRange(lmg.GenerateDesert(Land, IslandPoints));
            DrawLandMassFinishEvent?.Invoke(this, "Desert");
            //Swamp
            DrawLandMassStartEvent?.Invoke(this, "Swamp");
            Swamp.AddRange(lmg.GenerateSwamp(Land, IslandPoints));
            Swamp.AddRange(lmg.GenerateSwamp(Land, IslandPoints));
            Swamp.AddRange(lmg.GenerateSwamp(Land, IslandPoints));
            DrawLandMassFinishEvent?.Invoke(this, "Swamp");
            //Ocean
            DrawLandMassStartEvent?.Invoke(this, "Ocean");
            Ocean.AddRange(lmg.GenerateOcean(SizeX, SizeY));
            DrawLandMassFinishEvent?.Invoke(this, "Ocean");
            //SouthPole
            DrawLandMassStartEvent?.Invoke(this, "Polar caps");
            Land.AddRange(lmg.GenerateContinent(SizeX / 2, SizeY, SmallContinentPoints, SmallContinentSize, SmallContinentClusterPoints)); //Antartica Land
            Land.AddRange(lmg.GenerateIceCaps(SizeX, SizeY));
            DrawLandMassFinishEvent?.Invoke(this, "Polar caps");

            DrawLandMassStartEvent?.Invoke(this, "Consildated Map");
            Land = mc.ConsolidateGroupPoints(new List <PointGroup>()
            {
                Ocean, Land, Desert, Swamp
            });
            DrawLandMassFinishEvent?.Invoke(this, "Consildated Map");

            DrawLandMassStartEvent?.Invoke(this, "Wrap Map");
            Land = MapWrap(Land, SizeX);
            DrawLandMassFinishEvent?.Invoke(this, "Wrap Map");

            DrawLandMassStartEvent?.Invoke(this, "Color map");
            GameMap gamemap = ColorMap(Land, SizeX, SizeY);

            DrawLandMassFinishEvent?.Invoke(this, "Color map");

            return(gamemap);
        }