mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
generalise shared prng functionality to interfaces
This commit is contained in:
@ -6,3 +6,18 @@ public protocol RandomProvider {
|
||||
|
||||
mutating func next() -> Output
|
||||
}
|
||||
|
||||
public protocol RandomSeedable {
|
||||
associatedtype SeedType: FixedWidthInteger
|
||||
|
||||
init(seed: SeedType)
|
||||
mutating func seed(_ value: SeedType)
|
||||
}
|
||||
|
||||
public protocol RandomStateAccess {
|
||||
associatedtype StateType
|
||||
|
||||
var state: StateType { get set }
|
||||
|
||||
init(state: StateType)
|
||||
}
|
||||
|
Reference in New Issue
Block a user