public NoiseGenerator(ILogger logger, ChunkCreatorOptions chunkCreatorOptions) { _logger = logger; _noise = new FastNoiseLite(chunkCreatorOptions.Seed); _noise.SetNoiseType(FastNoiseLite.NoiseType.Cellular); _noise.SetSeed(chunkCreatorOptions.Seed); _noise.SetFrequency(0.05f); _noise.SetFractalOctaves(5); _noise.SetFractalLacunarity(3.0f); _noise.SetFractalType(FastNoiseLite.FractalType.Ridged); _noise.SetFractalGain(0.5f); _noise.SetCellularJitter(0.1f); _noise.SetCellularDistanceFunction(FastNoiseLite.CellularDistanceFunction.Euclidean); }
public ChunkCreator( ILogger logger, INoiseGenerator noiseGenerator, ChunkCreatorOptions chunkCreatorOptions) { _logger = logger; _noiseGenerator = noiseGenerator; _random = new Random(chunkCreatorOptions.Seed); _deepWaterTiles = new[] { new Tile { Id = 0 }, new Tile { Id = 1 }, new Tile { Id = 2 }, new Tile { Id = 3 } }; _shallowWaterTiles = new[] { new Tile { Id = 64 }, new Tile { Id = 65 }, new Tile { Id = 66 }, new Tile { Id = 67 } }; _coastTiles = new[] { new Tile { Id = 128 }, new Tile { Id = 129 }, new Tile { Id = 130 }, new Tile { Id = 131 } }; _sandTiles = new[] { new Tile { Id = 192 }, new Tile { Id = 193 }, new Tile { Id = 194 }, new Tile { Id = 195 } }; _grassTiles = new[] { new Tile { Id = 256 }, new Tile { Id = 257 }, new Tile { Id = 258 }, new Tile { Id = 259 } }; }