feat: remove battle count

This commit is contained in:
TrèsAbhi committed 2024-07-13 14:20:07 -05:00
1 parent f3174e8567
commit c6028b9868
4 files changed
+7 -14

No files matched your search

@@ -32,11 +32,6 @@ export const TankRow = memo<TankRowProps>(
Math.round(ratio * averages.samples[playerCountPeriod]), Math.round(ratio * averages.samples[playerCountPeriod]),
)} )}
</Table.Cell> </Table.Cell>
<Table.Cell align="center">
{formatCompact(
Math.round(ratio * averages.mu.battles * averages.samples.total),
)}
</Table.Cell>
<Table.Cell align="center"> <Table.Cell align="center">
{Math.round( {Math.round(
averages.mu.damage_dealt / averages.mu.battles, averages.mu.damage_dealt / averages.mu.battles,
@@ -7,6 +7,7 @@ import { averageDefinitionsArray } from '../../../../core/blitzkit/averageDefini
import { filterTank } from '../../../../core/blitzkit/filterTank'; import { filterTank } from '../../../../core/blitzkit/filterTank';
import { tankDefinitions } from '../../../../core/blitzkit/tankDefinitions'; import { tankDefinitions } from '../../../../core/blitzkit/tankDefinitions';
import * as TankFilters from '../../../../stores/tankFilters'; import * as TankFilters from '../../../../stores/tankFilters';
import * as TankPerformancePersistent from '../../../../stores/tankPerformancePersistent';
import * as TankPerformanceSort from '../../../../stores/tankPerformanceSort'; import * as TankPerformanceSort from '../../../../stores/tankPerformanceSort';
import { RowLoader } from './RowLoader'; import { RowLoader } from './RowLoader';
import { TankRow } from './TankRow'; import { TankRow } from './TankRow';
@@ -20,19 +21,16 @@ export function Tanks() {
const awaitedAverageDefinitionsArray = use(averageDefinitionsArray); const awaitedAverageDefinitionsArray = use(averageDefinitionsArray);
const filters = TankFilters.use(); const filters = TankFilters.use();
const sort = TankPerformanceSort.use(); const sort = TankPerformanceSort.use();
const tankPerformancePersistentStore = TankPerformancePersistent.useStore();
const tanksSorted = useMemo(() => { const tanksSorted = useMemo(() => {
const { playerCountPeriod } = tankPerformancePersistentStore.getState();
switch (sort.type) { switch (sort.type) {
case 'accuracy': case 'accuracy':
return awaitedAverageDefinitionsArray.sort( return awaitedAverageDefinitionsArray.sort(
(a, b) => (a, b) =>
sort.direction * (a.mu.hits / a.mu.shots - b.mu.hits / b.mu.shots), sort.direction * (a.mu.hits / a.mu.shots - b.mu.hits / b.mu.shots),
); );
case 'battles':
return awaitedAverageDefinitionsArray.sort(
(a, b) =>
sort.direction *
(a.samples.total * a.mu.battles - b.samples.total * b.mu.battles),
);
case 'capturePoints': case 'capturePoints':
return awaitedAverageDefinitionsArray.sort( return awaitedAverageDefinitionsArray.sort(
(a, b) => (a, b) =>
@@ -81,7 +79,9 @@ export function Tanks() {
); );
case 'players': case 'players':
return awaitedAverageDefinitionsArray.sort( return awaitedAverageDefinitionsArray.sort(
(a, b) => sort.direction * (a.samples.d_30 - b.samples.d_30), (a, b) =>
sort.direction *
(a.samples[playerCountPeriod] - b.samples[playerCountPeriod]),
); );
case 'spots': case 'spots':
return awaitedAverageDefinitionsArray.sort( return awaitedAverageDefinitionsArray.sort(
@@ -57,7 +57,6 @@ export const Total = memo<TotalProps>(
ratio * awaitedAverageDefinitions.samples[playerCountPeriod], ratio * awaitedAverageDefinitions.samples[playerCountPeriod],
)} )}
</Table.Cell> </Table.Cell>
<Table.Cell align="center">{formatCompact(ratio * battles)}</Table.Cell>
<Table.Cell align="center"> <Table.Cell align="center">
{Math.round(damage).toLocaleString()} {Math.round(damage).toLocaleString()}
</Table.Cell> </Table.Cell>
@@ -3,7 +3,6 @@ import { TankPerformanceSortType } from '.';
export const TankPerformanceSortTypeNames = { export const TankPerformanceSortTypeNames = {
winrate: 'Winrate', winrate: 'Winrate',
players: 'Players', players: 'Players',
battles: 'Battles (total)',
damage: 'Damage', damage: 'Damage',
survival: 'Survival', survival: 'Survival',
xp: 'XP', xp: 'XP',