Files
voxelotl-engine/Sources/Voxelotl/Random/RandomProvider.swift
2024-09-01 02:09:49 +10:00

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)
}