Files
voxelotl-engine/Sources/Voxelotl/Generator/WorldGenerator.swift

13 lines
382 B
Swift
Raw Normal View History

public protocol WorldGenerator {
2024-09-04 01:38:27 +10:00
mutating func reset(seed: UInt64)
func makeChunk(id: SIMD3<Int>) -> Chunk
}
internal extension RandomProvider where Output == UInt64, Self: RandomSeedable, SeedType == UInt64 {
static func createState(seed value: UInt64) -> (UInt64, UInt64) {
var hash = Self(seed: value)
let state = (hash.next(), hash.next())
return state
}
}