mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
tankClassOrder
This commit is contained in:
1 parent
9e26da3205
commit
a38239a6f9
8 files changed
+20
-91
No files matched your search
@@ -1,41 +0,0 @@
|
|||||||
import { TankClass, TankType } from "@blitzkit/protos";
|
|
||||||
import type { BlitzStats } from "../statistics";
|
|
||||||
|
|
||||||
export const TANK_TYPES = [
|
|
||||||
TankType.TANK_TYPE_RESEARCHABLE,
|
|
||||||
TankType.TANK_TYPE_PREMIUM,
|
|
||||||
TankType.TANK_TYPE_COLLECTOR,
|
|
||||||
];
|
|
||||||
|
|
||||||
export const TANK_TYPE_COMMAND_NAMES = {
|
|
||||||
[TankType.TANK_TYPE_RESEARCHABLE]: "researchable",
|
|
||||||
[TankType.TANK_TYPE_PREMIUM]: "premium",
|
|
||||||
[TankType.TANK_TYPE_COLLECTOR]: "collector",
|
|
||||||
};
|
|
||||||
|
|
||||||
export const TANK_CLASSES = [
|
|
||||||
TankClass.TANK_CLASS_LIGHT,
|
|
||||||
TankClass.TANK_CLASS_MEDIUM,
|
|
||||||
TankClass.TANK_CLASS_HEAVY,
|
|
||||||
TankClass.TANK_CLASS_TANK_DESTROYER,
|
|
||||||
];
|
|
||||||
|
|
||||||
export const emptyAllStats: BlitzStats = {
|
|
||||||
battles: 0,
|
|
||||||
capture_points: 0,
|
|
||||||
damage_dealt: 0,
|
|
||||||
damage_received: 0,
|
|
||||||
dropped_capture_points: 0,
|
|
||||||
frags: 0,
|
|
||||||
frags8p: 0,
|
|
||||||
hits: 0,
|
|
||||||
losses: 0,
|
|
||||||
max_frags: 0,
|
|
||||||
max_xp: 0,
|
|
||||||
shots: 0,
|
|
||||||
spotted: 0,
|
|
||||||
survived_battles: 0,
|
|
||||||
xp: 0,
|
|
||||||
win_and_survived: 0,
|
|
||||||
wins: 0,
|
|
||||||
};
|
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
export * from "./canSplash";
|
export * from "./canSplash";
|
||||||
export * from "./clans";
|
export * from "./clans";
|
||||||
export * from "./classes";
|
export * from "./classes";
|
||||||
export * from "./constants";
|
|
||||||
export * from "./equipmentPrice";
|
export * from "./equipmentPrice";
|
||||||
export * from "./fetchBlitz";
|
export * from "./fetchBlitz";
|
||||||
export * from "./fetchGlossary";
|
export * from "./fetchGlossary";
|
||||||
|
|||||||
@@ -1,22 +0,0 @@
|
|||||||
import { emptyAllStats } from '../../blitz/constants';
|
|
||||||
import { Samples } from '../../../../protos/src/blitzkit';
|
|
||||||
import type { BlitzkitStats } from '../../statistics';
|
|
||||||
|
|
||||||
export const emptyAverageDefinitionsAllStats: BlitzkitStats = {
|
|
||||||
...emptyAllStats,
|
|
||||||
battle_life_time: 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
export const averageDefinitionsAllStatsKeys = Object.keys(
|
|
||||||
emptyAverageDefinitionsAllStats,
|
|
||||||
) as (keyof BlitzkitStats)[];
|
|
||||||
|
|
||||||
export const emptySamples: Samples = {
|
|
||||||
d_1: 0,
|
|
||||||
d_7: 0,
|
|
||||||
d_30: 0,
|
|
||||||
d_60: 0,
|
|
||||||
d_90: 0,
|
|
||||||
d_120: 0,
|
|
||||||
total: 0,
|
|
||||||
};
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { staticAsset } from "@blitzkit/core";
|
|
||||||
import { AverageDefinitions } from "../../../../protos/src/blitzkit";
|
|
||||||
import { fetchPB } from "../../api";
|
|
||||||
|
|
||||||
export interface AverageDefinitionsManifest {
|
|
||||||
version: 1;
|
|
||||||
/**
|
|
||||||
* epoch in days
|
|
||||||
*/
|
|
||||||
latest: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function fetchAverage() {
|
|
||||||
return await fetchPB(staticAsset("averages.pb"), AverageDefinitions);
|
|
||||||
}
|
|
||||||
|
|
||||||
export * from "./constants";
|
|
||||||
@@ -2,7 +2,6 @@ export * from "./alias";
|
|||||||
export * from "./api";
|
export * from "./api";
|
||||||
export * from "./assertSecret";
|
export * from "./assertSecret";
|
||||||
export * from "./availableProvisions";
|
export * from "./availableProvisions";
|
||||||
export * from "./averageDefinitions";
|
|
||||||
export * from "./coefficient";
|
export * from "./coefficient";
|
||||||
export * from "./createDefaultProvisions";
|
export * from "./createDefaultProvisions";
|
||||||
export * from "./createDefaultSkills";
|
export * from "./createDefaultSkills";
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import { GameDefinitions, TankDefinition, TankType } from "@blitzkit/protos";
|
import { GameDefinitions, TankDefinition } from "@blitzkit/protos";
|
||||||
import { TANK_CLASSES } from "../blitz/constants";
|
import { tankClassOrder } from "../config/tankClassOrder";
|
||||||
|
import { treeTypeOrder } from "../config/treeTypeOrder";
|
||||||
const treeTypeOrder = [
|
|
||||||
TankType.TANK_TYPE_RESEARCHABLE,
|
|
||||||
TankType.TANK_TYPE_PREMIUM,
|
|
||||||
TankType.TANK_TYPE_COLLECTOR,
|
|
||||||
];
|
|
||||||
|
|
||||||
export function metaSortTank(
|
export function metaSortTank(
|
||||||
tanks: TankDefinition[],
|
tanks: TankDefinition[],
|
||||||
@@ -17,7 +12,8 @@ export function metaSortTank(
|
|||||||
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type),
|
(a, b) => treeTypeOrder.indexOf(b.type) - treeTypeOrder.indexOf(a.type),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) => TANK_CLASSES.indexOf(b.class) - TANK_CLASSES.indexOf(a.class),
|
(a, b) =>
|
||||||
|
tankClassOrder.indexOf(b.class) - tankClassOrder.indexOf(a.class),
|
||||||
)
|
)
|
||||||
.sort(
|
.sort(
|
||||||
(a, b) =>
|
(a, b) =>
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
import { TankClass } from "@blitzkit/protos";
|
||||||
|
|
||||||
|
export const tankClassOrder = [
|
||||||
|
TankClass.TANK_CLASS_LIGHT,
|
||||||
|
TankClass.TANK_CLASS_MEDIUM,
|
||||||
|
TankClass.TANK_CLASS_HEAVY,
|
||||||
|
TankClass.TANK_CLASS_TANK_DESTROYER,
|
||||||
|
];
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
import { TankType } from "@blitzkit/protos";
|
||||||
|
|
||||||
|
export const treeTypeOrder = [
|
||||||
|
TankType.TANK_TYPE_RESEARCHABLE,
|
||||||
|
TankType.TANK_TYPE_PREMIUM,
|
||||||
|
TankType.TANK_TYPE_COLLECTOR,
|
||||||
|
];
|
||||||
Reference in new issue
Block a user