fix: align reserved turn commands with legacy

This commit is contained in:
2026-07-25 14:16:59 +00:00
parent 36d11acdfa
commit 1fef287b6b
23 changed files with 816 additions and 189 deletions
+11
View File
@@ -26,6 +26,17 @@ export class RandUtil {
return minInclusive + this.rng.nextInt(span - 1);
}
/**
* Draw from the wrapped RNG's inclusive integer domain directly.
*
* Unlike nextInt(min, max), this deliberately consumes an RNG call when
* maxInclusive is zero. Legacy RandUtil::choice() has that observable
* behavior for a one-element collection.
*/
public nextIntInclusive(maxInclusive: number): number {
return this.rng.nextInt(maxInclusive);
}
public nextBit(): boolean {
const bits = this.rng.nextBits(1);
return bits[0]! != 0;