mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-11-28 12:23:24 +01:00
performance table rewrite and shared sort direction
This commit is contained in:
38 files changed
+965
-874
No files matched your search
@@ -2,7 +2,7 @@ import type { TankEnvironment } from "@blitzkit/core";
|
||||
import { Soapstone } from "soapstone";
|
||||
import { resolveTankModules } from "../tankopedia/resolveTankModules";
|
||||
import type { TankState } from "../tankopedia/tankState";
|
||||
import { TankopediaSortDirection } from "./tankopediaPersistent";
|
||||
import { SortDirection } from "./tankopediaPersistent";
|
||||
import type { TankSort } from "./tankopediaSort";
|
||||
|
||||
export interface CompareMember {
|
||||
@@ -24,7 +24,7 @@ export const CompareEphemeral = new Soapstone<
|
||||
environment,
|
||||
syncShells: false,
|
||||
members: [],
|
||||
sorting: { by: null, direction: TankopediaSortDirection.Descending },
|
||||
sorting: { by: null, direction: SortDirection.Descending },
|
||||
}));
|
||||
|
||||
// Picks the shell at the same slot on every member, where one exists
|
||||
|
||||
@@ -1,12 +1,24 @@
|
||||
import type { Samples } from "@blitzkit/protos";
|
||||
import { Soapstone } from "soapstone";
|
||||
|
||||
export interface Performance {
|
||||
playerCountPeriod: PlayerCountPeriod;
|
||||
}
|
||||
import type { PerformanceStatName } from "../config/performanceStats";
|
||||
import { SortDirection } from "./tankopediaPersistent";
|
||||
|
||||
export type PlayerCountPeriod = keyof Samples;
|
||||
|
||||
export interface PerformanceSort {
|
||||
by: PerformanceStatName;
|
||||
direction: SortDirection;
|
||||
}
|
||||
|
||||
export interface Performance {
|
||||
player_count_period: PlayerCountPeriod;
|
||||
sorting: PerformanceSort;
|
||||
}
|
||||
|
||||
export const Performance = new Soapstone<Performance>({
|
||||
playerCountPeriod: "total",
|
||||
player_count_period: "total",
|
||||
sorting: {
|
||||
by: "winrate",
|
||||
direction: SortDirection.Descending,
|
||||
},
|
||||
});
|
||||
@@ -1,6 +0,0 @@
|
||||
import en from '@blitzkit/i18n/strings/en.json';
|
||||
import type { TankPerformanceSortType } from '.';
|
||||
|
||||
export const TankPerformanceSortTypeNamesArray = Object.keys(
|
||||
en.website.tools.performance.table.stats,
|
||||
) as TankPerformanceSortType[];
|
||||
@@ -1,15 +0,0 @@
|
||||
import type en from "@blitzkit/i18n/strings/en.json";
|
||||
import { Soapstone } from "soapstone";
|
||||
|
||||
export type TankPerformanceSortType =
|
||||
keyof typeof en.website.tools.performance.table.stats;
|
||||
|
||||
export interface TankPerformanceSort {
|
||||
type: TankPerformanceSortType;
|
||||
direction: -1 | 1;
|
||||
}
|
||||
|
||||
export const TankPerformanceSort = new Soapstone<TankPerformanceSort>({
|
||||
type: "winrate",
|
||||
direction: -1,
|
||||
});
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Soapstone } from "soapstone";
|
||||
|
||||
export enum TankopediaSortDirection {
|
||||
export enum SortDirection {
|
||||
Ascending = "ascending",
|
||||
Descending = "descending",
|
||||
}
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { Soapstone } from "soapstone";
|
||||
import type { RenderedCharacteristicName } from "../types/characteristics";
|
||||
import { TankopediaSortDirection } from "./tankopediaPersistent";
|
||||
import { SortDirection } from "./tankopediaPersistent";
|
||||
|
||||
export interface TankSort {
|
||||
by: RenderedCharacteristicName | null;
|
||||
direction: TankopediaSortDirection;
|
||||
direction: SortDirection;
|
||||
}
|
||||
|
||||
export const TankSort = new Soapstone<TankSort>({
|
||||
by: null,
|
||||
direction: TankopediaSortDirection.Descending,
|
||||
direction: SortDirection.Descending,
|
||||
});
|
||||
Reference in new issue
Block a user