|
@@ -5,9 +5,11 @@ using System.Threading.Tasks;
|
|
|
using MineCase.Algorithm.Noise;
|
|
using MineCase.Algorithm.Noise;
|
|
|
using MineCase.Block;
|
|
using MineCase.Block;
|
|
|
using MineCase.Server.Game.Entities;
|
|
using MineCase.Server.Game.Entities;
|
|
|
|
|
+using MineCase.Server.World.Decoration.Mine;
|
|
|
using MineCase.Server.World.Decoration.Plants;
|
|
using MineCase.Server.World.Decoration.Plants;
|
|
|
using MineCase.World;
|
|
using MineCase.World;
|
|
|
using MineCase.World.Biomes;
|
|
using MineCase.World.Biomes;
|
|
|
|
|
+using MineCase.World.Generation;
|
|
|
using MineCase.World.Plants;
|
|
using MineCase.World.Plants;
|
|
|
using Orleans;
|
|
using Orleans;
|
|
|
|
|
|
|
@@ -15,6 +17,8 @@ namespace MineCase.Server.World.Decoration.Biomes
|
|
|
{
|
|
{
|
|
|
public abstract class BiomeDecoratorGrain : Grain, IBiomeDecorator
|
|
public abstract class BiomeDecoratorGrain : Grain, IBiomeDecorator
|
|
|
{
|
|
{
|
|
|
|
|
+ public GeneratorSettings GenSettings { get; set; } = new GeneratorSettings();
|
|
|
|
|
+
|
|
|
public BiomeProperties BiomeProperties { get; set; } = new BiomeProperties();
|
|
public BiomeProperties BiomeProperties { get; set; } = new BiomeProperties();
|
|
|
|
|
|
|
|
/** The block expected to be on the top of this biome */
|
|
/** The block expected to be on the top of this biome */
|
|
@@ -38,17 +42,34 @@ namespace MineCase.Server.World.Decoration.Biomes
|
|
|
|
|
|
|
|
public List<MobType> MonsterList { get; set; } = new List<MobType>();
|
|
public List<MobType> MonsterList { get; set; } = new List<MobType>();
|
|
|
|
|
|
|
|
- public virtual Task Decorate(IWorld world, ChunkWorldPos chunkWorldPos)
|
|
|
|
|
|
|
+ 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.Stone(StoneType.Granite), settings.GraniteCount, settings.GraniteSize, settings.GraniteMinHeight, settings.GraniteMaxHeight);
|
|
|
|
|
+ await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Stone(StoneType.Diorite), settings.DioriteCount, settings.DioriteSize, settings.DioriteMinHeight, settings.DioriteMaxHeight);
|
|
|
|
|
+ await oreGenerator.Generate(world, chunkWorldPos, BlockStates.Stone(StoneType.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);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ public virtual Task Decorate(IWorld world, ChunkWorldPos chunkWorldPos, GeneratorSettings settings)
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public virtual Task SpawnMob(IWorld world, ChunkWorldPos chunkWorldPos)
|
|
|
|
|
|
|
+ public virtual Task SpawnMob(IWorld world, ChunkWorldPos chunkWorldPos, GeneratorSettings settings)
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public virtual Task SpawnMonster(IWorld world, ChunkWorldPos chunkWorldPos)
|
|
|
|
|
|
|
+ public virtual Task SpawnMonster(IWorld world, ChunkWorldPos chunkWorldPos, GeneratorSettings settings)
|
|
|
{
|
|
{
|
|
|
throw new NotImplementedException();
|
|
throw new NotImplementedException();
|
|
|
}
|
|
}
|