1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2025-06-13 13:04:03 +00:00

Remove nextIntRangeInclusive

This function gave the minimum and maximum integer half as much weight, and it was not used anywhere except to generate a freeplay shape color palette, and that now uses nextIntRange.
This commit is contained in:
EmeraldBlock 2020-10-07 13:16:51 -05:00 committed by GitHub
parent 23c52c4379
commit 136867d82d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,17 +108,6 @@ export class RandomNumberGenerator {
assert(max > min, "rng: max <= min");
return Math.floor(this.next() * (max - min) + min);
}
/**
* @param {number} min
* @param {number} max
* @returns {number} Integer in range [min, max]
*/
nextIntRangeInclusive(min, max) {
assert(Number.isFinite(min), "Minimum is no integer");
assert(Number.isFinite(max), "Maximum is no integer");
assert(max > min, "rng: max <= min");
return Math.round(this.next() * (max - min) + min);
}
/**
* @param {number} min