Files
blitzkit/src/core/blitz/tankopedia.ts
T

52 lines
1.3 KiB
TypeScript
Raw Normal View History

import { readFileSync } from 'fs';
import { join } from 'path';
2023-06-01 18:36:39 +00:00
2023-06-05 18:47:00 +00:00
export type TankType = 'AT-SPG' | 'lightTank' | 'mediumTank' | 'heavyTank';
2023-06-03 18:25:33 +00:00
export interface TankopediaEntry {
name: string;
nation: string;
is_premium: boolean;
tier: number;
cost: { price_credit: number; price_gold: number };
images: { preview: string; normal: string };
tank_id: number;
2023-06-05 18:47:00 +00:00
type: TankType;
2023-06-03 18:25:33 +00:00
description: string;
}
2023-05-30 18:42:34 +00:00
export interface Tankopedia {
2023-06-03 18:25:33 +00:00
[id: number]: TankopediaEntry;
2023-05-30 18:42:34 +00:00
}
export const tankopedia = (
JSON.parse(
readFileSync(join(__dirname, 'tankopedia.json')) as unknown as string,
) as { data: Tankopedia }
).data;
const entries = Object.entries(tankopedia);
export const TANK_IDS = entries.map(([, { tank_id }]) => tank_id as number);
export const TANKS = entries.map(([, entry]) => entry as TankopediaEntry);
export const TANK_NAMES = entries.map(([, { name }]) => name);
2023-05-30 18:42:34 +00:00
2023-06-05 18:47:00 +00:00
export const TANK_ICONS: Record<TankType, string> = {
'AT-SPG': 'https://i.imgur.com/BIHSEH0.png',
lightTank: 'https://i.imgur.com/CSNha5V.png',
mediumTank: 'https://i.imgur.com/wvf3ltm.png',
heavyTank: 'https://i.imgur.com/ECeqlZa.png',
};
2023-06-19 18:08:34 +00:00
export type Tier = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
export const TIER_ROMAN_NUMERALS: Record<Tier, string> = {
2023-06-05 18:47:00 +00:00
1: 'I',
2: 'II',
3: 'III',
4: 'IV',
5: 'V',
6: 'VI',
7: 'VII',
8: 'VIII',
9: 'IX',
10: 'X',
2023-05-30 18:42:34 +00:00
};