コード例 #1
0
        public WorldGenerator(int seed, int width, int height)
        {
            this.seed = seed;
            this.width = width;
            this.height = height;

            // Initialize the terrain-type generators
            Generators = new Dictionary<NoiseWorldType, INoiseGenerator>();
            Generators[NoiseWorldType.Default] = InitializeDefault();

            // Initialize the modifiers handler
            Modifiers = new NoiseModifiers();
        }
コード例 #2
0
ファイル: NoiseManager.cs プロジェクト: JohanGl/Outworld-XNA
        /// <summary>
        /// Initializes the noise manager
        /// </summary>
        /// <param name="seed">The random seed to use</param>
        /// <param name="width">The width of the generated results</param>
        /// <param name="height">The height of the generated results</param>
        public NoiseManager(int? seed, int width, int height)
        {
            // Set the terrain seed
            this.seed = seed;

            // Initialize the terrain-type generators
            Generators = new Dictionary<NoiseGeneratorType, NoiseGenerator>();
            Generators[NoiseGeneratorType.Plains] = InitializePlains(width, height);
            Generators[NoiseGeneratorType.Mountains] = InitializeMountains(width, height);
            Generators[NoiseGeneratorType.MountainsBase] = InitializeMountainsBase(width, height);
            Generators[NoiseGeneratorType.Lakes] = InitializeLakes(width, height);
            Generators[NoiseGeneratorType.Seas] = InitializeSeas(width, height);
            Generators[NoiseGeneratorType.TerrainSpawners] = InitializeTerrainSpawners(width, height);
            Generators[NoiseGeneratorType.Custom] = InitializeCustom(width, height);

            // Initialize the modifiers handler
            Modifiers = new NoiseModifiers();
        }