feat: rename tank types to tank classes

This commit is contained in:
TrèsAbhi committed 2024-03-07 18:30:02 -06:00
1 parent 3325536bbc
commit 53174db351
18 files changed
+53 -64

No files matched your search

@@ -15,7 +15,7 @@ import {
} from '@radix-ui/themes';
import { go } from 'fuzzysort';
import { use, useEffect, useMemo, useRef, useState } from 'react';
import { TANK_TYPES, TreeType } from '../../../../../components/Tanks';
import { TANK_CLASSES, TreeType } from '../../../../../components/Tanks';
import { resolveNearPenetration } from '../../../../../core/blitz/resolveNearPenetration';
import { asset } from '../../../../../core/blitzkrieg/asset';
import { modelDefinitions } from '../../../../../core/blitzkrieg/modelDefinitions';
@@ -69,7 +69,7 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
)
.sort(
(a, b) =>
(TANK_TYPES.indexOf(a.type) - TANK_TYPES.indexOf(b.type)) *
(TANK_CLASSES.indexOf(a.class) - TANK_CLASSES.indexOf(b.class)) *
(sort.direction === 'descending' ? -1 : 1),
)
.sort(
@@ -88,7 +88,7 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
: filters.tiers.includes(tank.tier)) &&
(filters.types.length === 0
? true
: filters.types.includes(tank.type)) &&
: filters.types.includes(tank.class)) &&
(filters.treeTypes.length === 0
? true
: filters.treeTypes.includes(tank.treeType)) &&
@@ -843,7 +843,7 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
? TANK_ICONS_COLLECTOR
: tank.treeType === 'premium'
? TANK_ICONS_PREMIUM
: TANK_ICONS)[tank.type]
: TANK_ICONS)[tank.class]
}
style={{ width: '1em', height: '1em' }}
/>