Files
voxelotl-engine/Sources/Voxelotl/Random/RandomProvider.swift

24 lines
433 B
Swift
Raw Permalink Normal View History

2024-08-22 03:09:53 +10:00
public protocol RandomProvider {
associatedtype Output: FixedWidthInteger
static var min: Output { get }
static var max: Output { get }
mutating func next() -> Output
}
public protocol RandomSeedable {
2024-09-01 02:09:49 +10:00
associatedtype SeedType
init(seed: SeedType)
mutating func seed(_ value: SeedType)
}
public protocol RandomStateAccess {
associatedtype StateType
var state: StateType { get set }
init(state: StateType)
}