fix: tier list filters

This commit is contained in:
TrèsAbhi committed 2025-10-11 21:49:20 -05:00
1 parent a4e48a2feb
commit 9914371dd8
2 files changed
+17 -14

No files matched your search

+6 -6
View File
@@ -1,5 +1,5 @@
import { TANK_CLASSES } from '../blitz/constants';
import { GameDefinitions, TankDefinition, TankType } from '../protos';
import { TANK_CLASSES } from "../blitz/constants";
import { GameDefinitions, TankDefinition, TankType } from "../protos";
const treeTypeOrder = [
TankType.RESEARCHABLE,
@@ -9,20 +9,20 @@ const treeTypeOrder = [
export function metaSortTank(
tanks: TankDefinition[],
gameDefinitions: GameDefinitions,
gameDefinitions: GameDefinitions
) {
return tanks
.sort((a, b) => b.tier - a.tier)
.sort(
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type),
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type)
)
.sort(
(a, b) => TANK_CLASSES.indexOf(b.class) - TANK_CLASSES.indexOf(a.class),
(a, b) => TANK_CLASSES.indexOf(b.class) - TANK_CLASSES.indexOf(a.class)
)
.sort(
(a, b) =>
gameDefinitions.nations.indexOf(b.nation) -
gameDefinitions.nations.indexOf(a.nation),
gameDefinitions.nations.indexOf(a.nation)
)
.sort((a, b) => a.tier - b.tier);
}