mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-17 23:59:18 +00:00
update & refactor MapPlaylist: remove big/small map distinction, ensure no map is repeated within 5 rounds, update how map is shuffled
This commit is contained in:
@@ -48,7 +48,7 @@ export class PseudoRandom {
|
||||
return this.nextInt(0, odds) == 0;
|
||||
}
|
||||
|
||||
shuffleArray(array: any[]) {
|
||||
shuffleArray(array: any[]): any[] {
|
||||
for (let i = array.length - 1; i >= 0; i--) {
|
||||
const j = Math.floor(this.nextInt(0, i + 1));
|
||||
[array[i], array[j]] = [array[j], array[i]];
|
||||
|
||||
Reference in New Issue
Block a user