예제 #1
0
        /// <summary>
        /// Generate a continent
        /// </summary>
        /// <param name="x">X start</param>
        /// <param name="y">Y start</param>
        /// <param name="clusters">Number of clusters</param>
        /// <param name="clustersize">distance between cluster center nodes</param>
        /// <param name="clusterpoints">Number of points in each cluster.</param>
        /// <returns>Continent</returns>
        public PointGroup GenerateContinent(int x, int y, int clusters, int clustersize, int clusterpoints)
        {
            PointGroupGenerator pgg          = new PointGroupGenerator();
            PointGroup          clusternodes = pgg.GenerateCluster(x, y, clusters, MapTerrain.Plains, clustersize);
            PointGroup          landmass     = new PointGroup();

            foreach (MapPoint mp in clusternodes)
            {
                landmass.AddRange(pgg.GenerateCluster(mp.X, mp.Y, clusterpoints, MapTerrain.Plains, 5));
            }
            return(landmass);
        }
예제 #2
0
        /// <summary>
        /// Generate a desert
        /// </summary>
        /// <param name="pg">LandMass desert belongs to.</param>
        /// <param name="points">Points in desert.</param>
        /// <param name="dist">distance between desert points</param>
        /// <returns>Desert PointGroup</returns>
        public PointGroup GenerateDesert(PointGroup pg, int points, int dist = 5)
        {
            MapPoint            mp  = pg.GetPointFromBounds();
            PointGroupGenerator pgg = new PointGroupGenerator();

            return(pgg.GenerateCluster(mp.X, mp.Y, points, MapTerrain.Desert, dist));
        }
예제 #3
0
        /// <summary>
        /// Generate a swamp
        /// </summary>
        /// <param name="pg">LandMass swamp belongs to.</param>
        /// <param name="size">Size of swamp</param>
        /// <param name="dist">distance between swamp points</param>
        /// <returns>Swamp PointGroup</returns>
        public PointGroup GenerateSwamp(PointGroup pg, int size, int dist = 5)
        {
            MapPoint            mp  = pg.GetPointFromBounds();
            PointGroupGenerator pgg = new PointGroupGenerator();

            return(pgg.GenerateCluster(mp.X, mp.Y, size, MapTerrain.Swamp, dist));
        }