mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 05:10:57 +00:00
24 lines
433 B
Swift
24 lines
433 B
Swift
public protocol RandomProvider {
|
|
associatedtype Output: FixedWidthInteger
|
|
|
|
static var min: Output { get }
|
|
static var max: Output { get }
|
|
|
|
mutating func next() -> Output
|
|
}
|
|
|
|
public protocol RandomSeedable {
|
|
associatedtype SeedType
|
|
|
|
init(seed: SeedType)
|
|
mutating func seed(_ value: SeedType)
|
|
}
|
|
|
|
public protocol RandomStateAccess {
|
|
associatedtype StateType
|
|
|
|
var state: StateType { get set }
|
|
|
|
init(state: StateType)
|
|
}
|