コード例 #1
0
        protected async Task GenerateOre(IWorld world, ChunkWorldPos chunkWorldPos, GeneratorSettings settings)
        {
            var oreGenerator = GrainFactory.GetGrain <IMinableGenerator>(0);
            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Dirt(), settings.DirtCount, settings.DirtSize, settings.DirtMinHeight, settings.DirtMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Gravel(), settings.GravelCount, settings.GravelSize, settings.GravelMinHeight, settings.GravelMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Granite(), settings.GraniteCount, settings.GraniteSize, settings.GraniteMinHeight, settings.GraniteMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Diorite(), settings.DioriteCount, settings.DioriteSize, settings.DioriteMinHeight, settings.DioriteMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Andesite(), settings.AndesiteCount, settings.AndesiteSize, settings.AndesiteMinHeight, settings.AndesiteMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.CoalOre(), settings.CoalCount, settings.CoalSize, settings.CoalMinHeight, settings.CoalMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.IronOre(), settings.IronCount, settings.IronSize, settings.IronMinHeight, settings.IronMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.GoldOre(), settings.GoldCount, settings.GoldSize, settings.GoldMinHeight, settings.GoldMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.DiamondOre(), settings.DiamondCount, settings.DiamondSize, settings.DiamondMinHeight, settings.DiamondMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.RedstoneOre(), settings.RedstoneCount, settings.RedstoneSize, settings.RedstoneMinHeight, settings.RedstoneMaxHeight);

            await oreGenerator.Generate(world, chunkWorldPos, BlockStates.LapisLazuliOre(), settings.LapisCount, settings.LapisSize, settings.LapisCenterHeight - settings.LapisSpread, settings.LapisCenterHeight + settings.LapisSpread);
        }
コード例 #2
0
        public void IsIdTest()
        {
            BlockState state1 = BlockStates.Diorite();
            BlockState state2 = BlockStates.Leaves(LeaveType.Birch);
            BlockState state3 = BlockStates.Wood(WoodType.Birch);
            BlockState state4 = BlockStates.Wood(WoodType.Oak);

            Assert.True(state1.IsId(BlockId.Diorite));

            // Assert.True(state2.IsId(BlockId.Leaves));
            // Assert.True(state3.IsId(BlockId.Wood));
            // Assert.True(state4.IsId(BlockId.Wood));
            Assert.False(state1.IsId(BlockId.Cobblestone));
            Assert.False(state2.IsId(BlockId.Dirt));
            Assert.False(state3.IsId(BlockId.Stone));
            Assert.False(state4.IsId(BlockId.Stone));
        }
コード例 #3
0
        public void IsIdTest()
        {
            BlockState state1 = BlockStates.Diorite();
            BlockState state2 = BlockStates.BirchLeaves(BirchLeavesDistanceType.Distance1, BirchLeavesPersistentType.False);
            BlockState state3 = BlockStates.BirchLog();
            BlockState state4 = BlockStates.OakLog();

            Assert.True(state1.IsId(BlockId.Diorite));

            // Assert.True(state2.IsId(BlockId.Leaves));
            // Assert.True(state3.IsId(BlockId.Wood));
            // Assert.True(state4.IsId(BlockId.Wood));
            Assert.False(state1.IsId(BlockId.Cobblestone));
            Assert.False(state2.IsId(BlockId.Dirt));
            Assert.False(state3.IsId(BlockId.Stone));
            Assert.False(state4.IsId(BlockId.Stone));
        }
コード例 #4
0
        public Biome(BiomeProperties properties, GeneratorSettings genSettings)
        {
            _genSettings = genSettings;

            _name            = properties.BiomeName;
            _biomeId         = properties.BiomeId;
            _baseHeight      = properties.BaseHeight;
            _heightVariation = properties.HeightVariation;
            _temperature     = properties.Temperature;
            _rainfall        = properties.Rainfall;
            _waterColor      = properties.WaterColor;
            _enableSnow      = properties.EnableSnow;
            _enableRain      = properties.EnableRain;

            _dirtGen = new MinableGenerator(
                BlockStates.Dirt(),
                genSettings.DirtSize);
            _gravelOreGen = new MinableGenerator(
                BlockStates.Gravel(),
                genSettings.GravelSize);
            _graniteGen = new MinableGenerator(
                BlockStates.Granite(),
                genSettings.GraniteSize);
            _dioriteGen = new MinableGenerator(
                BlockStates.Diorite(),
                genSettings.DioriteSize);
            _andesiteGen = new MinableGenerator(
                BlockStates.Andesite(),
                genSettings.AndesiteSize);
            _coalGen = new MinableGenerator(
                BlockStates.CoalOre(),
                genSettings.CoalSize);
            _ironGen = new MinableGenerator(
                BlockStates.IronOre(),
                genSettings.IronSize);
            _goldGen = new MinableGenerator(
                BlockStates.GoldOre(),
                genSettings.GoldSize);

            _redstoneGen = new MinableGenerator(
                BlockStates.RedstoneOre(),
                genSettings.RedstoneSize);
            _diamondGen = new MinableGenerator(
                BlockStates.DiamondOre(),
                genSettings.DiamondSize);
            _lapisGen = new MinableGenerator(
                BlockStates.LapisLazuliOre(),
                genSettings.LapisSize);

            _treesPerChunk     = 0;     // mc 0
            _extraTreeChance   = 0.05F; // mc 0.05F
            _grassPerChunk     = 10;
            _flowersPerChunk   = 4;
            _mushroomsPerChunk = 0;

            _deadBushPerChunk = 2;
            _reedsPerChunk    = 50;
            _cactiPerChunk    = 10;

            _passiveMobList = new List <MobType>();
            _monsterList    = new List <MobType>();
        }