refactor: rename RNG method from nextFloat to nextFloat1 for consistency across the codebase

This commit is contained in:
2026-01-24 13:58:12 +00:00
parent 8735d350fa
commit f199427ff1
17 changed files with 46 additions and 67 deletions
@@ -166,7 +166,7 @@ const aftermathConfig: WarAftermathConfig = {
};
const rng = {
nextFloat: () => 0.1,
nextFloat1: () => 0.1,
nextBool: (probability: number) => probability >= 0.1,
nextInt: (minInclusive: number, _maxExclusive: number) => minInclusive,
};
@@ -175,7 +175,7 @@ describe('General Commands New Scenario', () => {
nextBool: () => true,
nextRange: (_min: number, max: number) => max,
nextRangeInt: (_min: number, max: number) => max,
nextFloat: () => 0.9, // Ensure success
nextFloat1: () => 0.9, // Ensure success
},
},
},
@@ -121,7 +121,7 @@ class ReservedTurnRunner extends TestGameRunner {
// Simple RNG mock
const rng: RandomGenerator = {
nextFloat: () => 0.5,
nextFloat1: () => 0.5,
nextBool: () => true,
nextInt: (min: number, _max: number) => min,
};
+1 -1
View File
@@ -229,7 +229,7 @@ describe('trait modules', () => {
listGenerals: () => [general, patient],
};
const rng: RandomGenerator = {
nextFloat: () => 0,
nextFloat1: () => 0,
nextBool: () => true,
nextInt: (minInclusive: number, _maxExclusive: number) => minInclusive,
};
+1 -1
View File
@@ -211,7 +211,7 @@ export class TestGameRunner {
nextBool: () => Math.random() < 0.5,
nextRange: (min: number, max: number) => Math.random() * (max - min) + min,
nextRangeInt: (min: number, max: number) => Math.floor(Math.random() * (max - min)) + min,
nextFloat: () => Math.random(),
nextFloat1: () => Math.random(),
} as any,
year: this.currentDate.getFullYear(),