tower world gen

This commit is contained in:
2024-09-04 01:38:27 +10:00
parent f77b64cc85
commit 080522e01b
9 changed files with 168 additions and 49 deletions

View File

@ -0,0 +1,12 @@
protocol WorldGenerator {
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
}
}