mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 03:59:50 +02:00
feat: shuffle button
This commit is contained in:
1 parent
ff4a87e5b8
commit
263f292a59
6 files changed
+33
-26
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import {
|
||||
fisherYates,
|
||||
getTankStats,
|
||||
idToRegion,
|
||||
type IndividualTankStats,
|
||||
@@ -24,14 +25,10 @@ export async function generatePlaylist() {
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = filtered.length - 1; i > 0; i--) {
|
||||
const j = Math.floor(Math.random() * (i + 1));
|
||||
[filtered[i], filtered[j]] = [filtered[j], filtered[i]];
|
||||
}
|
||||
fisherYates(filtered);
|
||||
|
||||
Playlist.mutate((draft) => {
|
||||
draft.list = filtered.map((tank, index) => ({
|
||||
index,
|
||||
draft.list = filtered.map((tank) => ({
|
||||
tank,
|
||||
battles: stats[tank.id]?.all.battles,
|
||||
wins: stats[tank.id]?.all.wins,
|
||||
|
||||
Reference in new issue
Block a user