mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-08 12:51:51 +09:00
savegame format upd?
This commit is contained in:
@@ -18,6 +18,13 @@ import kotlin.math.roundToInt
|
||||
internal class RNGPool() {
|
||||
private val RNG = HQRNG()
|
||||
private val used = SortedArrayList<Int>()
|
||||
|
||||
init {
|
||||
for (i in 0 until 32767) {
|
||||
used.add(i)
|
||||
}
|
||||
}
|
||||
|
||||
fun next(): Int {
|
||||
var n = RNG.nextLong().ushr(32).toInt()
|
||||
while (used.contains(n)) {
|
||||
|
||||
Reference in New Issue
Block a user