mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: more defs
This commit is contained in:
1 parent
2e2ab9b2d9
commit
66dbc5b2ed
10 files changed
+192
-73
No files matched your search
+147
-57
@@ -8,16 +8,21 @@ import { SCPGStream } from '../src/core/blitz/SCPGStream';
|
|||||||
import { readBase64DVPL } from '../src/core/blitz/readBase64DVPL';
|
import { readBase64DVPL } from '../src/core/blitz/readBase64DVPL';
|
||||||
import { readXMLDVPL } from '../src/core/blitz/readXMLDVPL';
|
import { readXMLDVPL } from '../src/core/blitz/readXMLDVPL';
|
||||||
import { readYAMLDVPL } from '../src/core/blitz/readYAMLDVPL';
|
import { readYAMLDVPL } from '../src/core/blitz/readYAMLDVPL';
|
||||||
|
import { toUniqueId } from '../src/core/blitz/toUniqueId';
|
||||||
import commitMultipleFiles, {
|
import commitMultipleFiles, {
|
||||||
FileChange,
|
FileChange,
|
||||||
} from '../src/core/blitzkrieg/commitMultipleFiles';
|
} from '../src/core/blitzkrieg/commitMultipleFiles';
|
||||||
|
import { BlitzkriegGunDefinitions } from '../src/core/blitzkrieg/definitions/guns';
|
||||||
import {
|
import {
|
||||||
TankDefinitions,
|
BlitzkriegTankDefinitions,
|
||||||
Tier,
|
Tier,
|
||||||
} from '../src/core/blitzkrieg/definitions/tanks';
|
} from '../src/core/blitzkrieg/definitions/tanks';
|
||||||
|
import { BlitzkriegTurretDefinitions } from '../src/core/blitzkrieg/definitions/turrets';
|
||||||
|
|
||||||
config();
|
config();
|
||||||
|
|
||||||
|
// WARNING! MOST OF THESE TYPES ARE NOT EXHAUSTIVE!
|
||||||
|
|
||||||
interface VehicleDefinitionList {
|
interface VehicleDefinitionList {
|
||||||
[key: string]: {
|
[key: string]: {
|
||||||
id: number;
|
id: number;
|
||||||
@@ -34,13 +39,41 @@ interface VehicleDefinitionList {
|
|||||||
configurationModes: string;
|
configurationModes: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
interface TurretDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
}
|
||||||
|
interface GunDefinitionsList {
|
||||||
|
nextAvailableId: number;
|
||||||
|
ids: Record<string, number>;
|
||||||
|
shared: {
|
||||||
|
[key: string]: {
|
||||||
|
userString: string;
|
||||||
|
tags: string;
|
||||||
|
level: number;
|
||||||
|
pitchLimits: string;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
interface VehicleDefinitions {
|
||||||
|
turrets0: {
|
||||||
|
[key: string]: {
|
||||||
|
userString: number;
|
||||||
|
level: number;
|
||||||
|
yawLimits: string | string[];
|
||||||
|
guns: {
|
||||||
|
[key: string]: {
|
||||||
|
maxAmmo: number;
|
||||||
|
pitchLimits?: string | string[];
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
interface Strings {
|
interface Strings {
|
||||||
[key: string]: string;
|
[key: string]: string;
|
||||||
}
|
}
|
||||||
type BlitzTankType = 'AT-SPG' | 'lightTank' | 'mediumTank' | 'heavyTank';
|
type BlitzTankType = 'AT-SPG' | 'lightTank' | 'mediumTank' | 'heavyTank';
|
||||||
/**
|
|
||||||
* Warning! This is not exhaustive.
|
|
||||||
*/
|
|
||||||
interface TankParameters {
|
interface TankParameters {
|
||||||
resourcesPath: {
|
resourcesPath: {
|
||||||
smallIconPath: string;
|
smallIconPath: string;
|
||||||
@@ -76,10 +109,12 @@ const targets = argv
|
|||||||
|
|
||||||
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
if (!targets && !allTargets) throw new Error('No target(s) specified');
|
||||||
|
|
||||||
if (allTargets || targets?.includes('tankDefinitions')) {
|
if (allTargets || targets?.includes('definitions')) {
|
||||||
console.log('Building tank definitions...');
|
console.log('Building tank definitions...');
|
||||||
|
|
||||||
const tankDefinitions: TankDefinitions = {};
|
const tankDefinitions: BlitzkriegTankDefinitions = {};
|
||||||
|
const turretDefinitions: BlitzkriegTurretDefinitions = {};
|
||||||
|
const gunDefinitions: BlitzkriegGunDefinitions = {};
|
||||||
const nations = await readdir(`${DATA}/${DOI.vehicleDefinitions}`).then(
|
const nations = await readdir(`${DATA}/${DOI.vehicleDefinitions}`).then(
|
||||||
(nations) => nations.filter((nation) => nation !== 'common'),
|
(nations) => nations.filter((nation) => nation !== 'common'),
|
||||||
);
|
);
|
||||||
@@ -89,65 +124,120 @@ if (allTargets || targets?.includes('tankDefinitions')) {
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
nations.map(async (nation) => {
|
nations.map(async (nation) => {
|
||||||
const tanks = await readXMLDVPL<VehicleDefinitionList>(
|
const tankList = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||||
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||||
);
|
);
|
||||||
|
const turretList = await readXMLDVPL<{
|
||||||
|
root: TurretDefinitionsList;
|
||||||
|
}>(
|
||||||
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/components/turrets.xml.dvpl`,
|
||||||
|
);
|
||||||
|
const gunList = await readXMLDVPL<{
|
||||||
|
root: GunDefinitionsList;
|
||||||
|
}>(
|
||||||
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/components/guns.xml.dvpl`,
|
||||||
|
);
|
||||||
|
|
||||||
for (const tankIndex in tanks) {
|
for (const tankKey in tankList.root) {
|
||||||
const tank = tanks[tankIndex];
|
const tank = tankList.root[tankKey];
|
||||||
const nationVehicleId = tank.id;
|
const tankDefinition = await readXMLDVPL<{ root: VehicleDefinitions }>(
|
||||||
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/${tankKey}.xml.dvpl`,
|
||||||
const name = strings[tank.userString] ?? tankIndex;
|
);
|
||||||
const name_short = tank.shortUserString
|
const tankId = toUniqueId(nation, tank.id);
|
||||||
? strings[tank.shortUserString] === name
|
const tankTags = tank.tags.split(' ');
|
||||||
? undefined
|
const tankTurrets = Object.keys(tankDefinition.root.turrets0).map(
|
||||||
: strings[tank.shortUserString]
|
(turretKey) => {
|
||||||
: undefined;
|
const turret = tankDefinition.root.turrets0[turretKey];
|
||||||
const isPremium =
|
const turretId = toUniqueId(nation, turretList.root.ids[turretKey]);
|
||||||
typeof tank.price === 'number' ? false : 'gold' in tank.price;
|
const turretGuns = Object.keys(turret.guns).map((gunKey) =>
|
||||||
const isCollector = tank.sellPrice ? 'gold' in tank.sellPrice : false;
|
toUniqueId(nation, gunList.root.ids[gunKey]),
|
||||||
const tier = tank.level as Tier;
|
);
|
||||||
const tags = tank.tags.split(' ');
|
|
||||||
const type = blitzTankTypeToBlitzkrieg[tags[0] as BlitzTankType];
|
|
||||||
const testing = tags.includes('testTank') ? true : undefined;
|
|
||||||
|
|
||||||
if ((name ?? name_short) === undefined) {
|
turretDefinitions[turretId] = {
|
||||||
console.warn(`Missing name for ${tankIndex}`);
|
id: turretId,
|
||||||
}
|
name:
|
||||||
|
strings[turret.userString] ??
|
||||||
|
turretKey
|
||||||
|
.replaceAll('_', ' ')
|
||||||
|
.replace(/^(Turret ([0-9] )?)+/, ''),
|
||||||
|
tier: turret.level,
|
||||||
|
yaw: (typeof turret.yawLimits === 'string'
|
||||||
|
? turret.yawLimits
|
||||||
|
: turret.yawLimits[0]
|
||||||
|
)
|
||||||
|
.split(' ')
|
||||||
|
.map(Number) as [number, number],
|
||||||
|
guns: turretGuns,
|
||||||
|
};
|
||||||
|
|
||||||
tankDefinitions[id] = {
|
return turretId;
|
||||||
id,
|
},
|
||||||
name,
|
);
|
||||||
name_short,
|
|
||||||
|
tankDefinitions[tankId] = {
|
||||||
|
id: tankId,
|
||||||
|
name:
|
||||||
|
(tank.shortUserString
|
||||||
|
? strings[tank.shortUserString]
|
||||||
|
: undefined) ??
|
||||||
|
strings[tank.userString] ??
|
||||||
|
tankKey.replaceAll('_', ' '),
|
||||||
nation,
|
nation,
|
||||||
tree_type: isCollector
|
tree_type: (tank.sellPrice ? 'gold' in tank.sellPrice : false)
|
||||||
? 'collector'
|
? 'collector'
|
||||||
: isPremium
|
: (typeof tank.price === 'number' ? false : 'gold' in tank.price)
|
||||||
? 'premium'
|
? 'premium'
|
||||||
: 'researchable',
|
: 'researchable',
|
||||||
tier,
|
tier: tank.level as Tier,
|
||||||
type,
|
type: blitzTankTypeToBlitzkrieg[tankTags[0] as BlitzTankType],
|
||||||
testing,
|
testing: tankTags.includes('testTank') ? true : undefined,
|
||||||
|
turrets: tankTurrets,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.keys(gunList.root.ids).forEach((gunKey) => {
|
||||||
|
const gun = gunList.root.shared[gunKey];
|
||||||
|
const gunId = toUniqueId(nation, gunList.root.ids[gunKey]);
|
||||||
|
|
||||||
|
gunDefinitions[gunId] = {
|
||||||
|
id: gunId,
|
||||||
|
name: strings[gun.userString] ?? gunKey.replaceAll('_', ' '),
|
||||||
|
tier: gun.level,
|
||||||
|
pitch: gun.pitchLimits.split(' ').map(Number) as [number, number],
|
||||||
|
};
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log('Committing tank definitions...');
|
// rmSync('dist/definitions', { force: true, recursive: true });
|
||||||
await commitMultipleFiles(
|
// mkdirSync('dist/definitions', { recursive: true });
|
||||||
'tresabhi',
|
// writeFile(
|
||||||
'blitzkrieg-assets',
|
// 'dist/definitions/tanks.json',
|
||||||
'main',
|
// JSON.stringify(tankDefinitions, null, 2),
|
||||||
'tank definitions',
|
// );
|
||||||
[
|
// writeFile(
|
||||||
{
|
// 'dist/definitions/turrets.json',
|
||||||
content: JSON.stringify(tankDefinitions),
|
// JSON.stringify(turretDefinitions, null, 2),
|
||||||
encoding: 'utf-8',
|
// );
|
||||||
path: 'definitions/tanks.json',
|
// writeFile(
|
||||||
},
|
// 'dist/definitions/guns.json',
|
||||||
],
|
// JSON.stringify(gunDefinitions, null, 2),
|
||||||
true,
|
// );
|
||||||
);
|
// console.log('Committing tank definitions...');
|
||||||
|
// await commitMultipleFiles(
|
||||||
|
// 'tresabhi',
|
||||||
|
// 'blitzkrieg-assets',
|
||||||
|
// 'main',
|
||||||
|
// 'tank definitions',
|
||||||
|
// [
|
||||||
|
// {
|
||||||
|
// content: JSON.stringify(tankDefinitions),
|
||||||
|
// encoding: 'utf-8',
|
||||||
|
// path: 'definitions/tanks.json',
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// true,
|
||||||
|
// );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -164,12 +254,12 @@ if (
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
nations.map(async (nation) => {
|
nations.map(async (nation) => {
|
||||||
const tanks = await readXMLDVPL<VehicleDefinitionList>(
|
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||||
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const tankIndex in tanks) {
|
for (const tankIndex in tanks.root) {
|
||||||
const tank = tanks[tankIndex];
|
const tank = tanks.root[tankIndex];
|
||||||
const nationVehicleId = tank.id;
|
const nationVehicleId = tank.id;
|
||||||
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
||||||
const parameters = await readYAMLDVPL<TankParameters>(
|
const parameters = await readYAMLDVPL<TankParameters>(
|
||||||
@@ -289,12 +379,12 @@ if (allTargets || targets?.includes('tankModels')) {
|
|||||||
|
|
||||||
await Promise.all(
|
await Promise.all(
|
||||||
nations.map(async (nation) => {
|
nations.map(async (nation) => {
|
||||||
const tanks = await readXMLDVPL<VehicleDefinitionList>(
|
const tanks = await readXMLDVPL<{ root: VehicleDefinitionList }>(
|
||||||
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
`${DATA}/${DOI.vehicleDefinitions}/${nation}/list.xml.dvpl`,
|
||||||
);
|
);
|
||||||
|
|
||||||
for (const tankIndex in tanks) {
|
for (const tankIndex in tanks.root) {
|
||||||
const tank = tanks[tankIndex];
|
const tank = tanks.root[tankIndex];
|
||||||
const nationVehicleId = tank.id;
|
const nationVehicleId = tank.id;
|
||||||
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
const id = (nationVehicleId << 8) + (NATION_IDS[nation] << 4) + 1;
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { TreeTypeEnum } from '../../../components/Tanks';
|
|||||||
import { WARGAMING_APPLICATION_ID } from '../../../constants/wargamingApplicationID';
|
import { WARGAMING_APPLICATION_ID } from '../../../constants/wargamingApplicationID';
|
||||||
import fetchBlitz from '../../../core/blitz/fetchBlitz';
|
import fetchBlitz from '../../../core/blitz/fetchBlitz';
|
||||||
import {
|
import {
|
||||||
TankDefinition,
|
BlitzkriegTankDefinition,
|
||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
} from '../../../core/blitzkrieg/definitions/tanks';
|
} from '../../../core/blitzkrieg/definitions/tanks';
|
||||||
import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
import { tankAverages } from '../../../core/blitzstars/tankAverages';
|
||||||
@@ -30,7 +30,7 @@ export default function SessionPage() {
|
|||||||
|
|
||||||
list: {
|
list: {
|
||||||
stats: IndividualTankStats;
|
stats: IndividualTankStats;
|
||||||
tankDefinitions?: TankDefinition;
|
tankDefinitions?: BlitzkriegTankDefinition;
|
||||||
career: IndividualTankStats;
|
career: IndividualTankStats;
|
||||||
currentWN8?: number;
|
currentWN8?: number;
|
||||||
careerWN8?: number;
|
careerWN8?: number;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import { CaretLeftIcon, CaretRightIcon } from '@radix-ui/react-icons';
|
import { CaretLeftIcon, CaretRightIcon } from '@radix-ui/react-icons';
|
||||||
import { Button, Flex, TextField } from '@radix-ui/themes';
|
import { Button, Flex, TextField } from '@radix-ui/themes';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
import { TankDefinition } from '../../../../core/blitzkrieg/definitions/tanks';
|
import { BlitzkriegTankDefinition } from '../../../../core/blitzkrieg/definitions/tanks';
|
||||||
|
|
||||||
interface PageTurnerProps {
|
interface PageTurnerProps {
|
||||||
page: number;
|
page: number;
|
||||||
setPage: (page: number) => void;
|
setPage: (page: number) => void;
|
||||||
searchedList: TankDefinition[];
|
searchedList: BlitzkriegTankDefinition[];
|
||||||
tanksPerPage: number;
|
tanksPerPage: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,11 +20,11 @@ import { Suspense, use, useEffect, useMemo, useRef, useState } from 'react';
|
|||||||
import PageWrapper from '../../../components/PageWrapper';
|
import PageWrapper from '../../../components/PageWrapper';
|
||||||
import { asset } from '../../../core/blitzkrieg/asset';
|
import { asset } from '../../../core/blitzkrieg/asset';
|
||||||
import {
|
import {
|
||||||
|
BlitzkriegTankDefinition,
|
||||||
TANK_ICONS,
|
TANK_ICONS,
|
||||||
TANK_ICONS_COLLECTOR,
|
TANK_ICONS_COLLECTOR,
|
||||||
TANK_ICONS_PREMIUM,
|
TANK_ICONS_PREMIUM,
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
TankDefinition,
|
|
||||||
tanksDefinitionsArray,
|
tanksDefinitionsArray,
|
||||||
} from '../../../core/blitzkrieg/definitions/tanks';
|
} from '../../../core/blitzkrieg/definitions/tanks';
|
||||||
import { tankIcon } from '../../../core/blitzkrieg/tankIcon';
|
import { tankIcon } from '../../../core/blitzkrieg/tankIcon';
|
||||||
@@ -125,7 +125,7 @@ export default function Page() {
|
|||||||
'name',
|
'name',
|
||||||
'name_short',
|
'name_short',
|
||||||
'id',
|
'id',
|
||||||
] satisfies (keyof TankDefinition)[],
|
] satisfies (keyof BlitzkriegTankDefinition)[],
|
||||||
}).map(({ obj }) => obj),
|
}).map(({ obj }) => obj),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import getTankStats from '../core/blitz/getTankStats';
|
|||||||
import getTreeType from '../core/blitz/getTreeType';
|
import getTreeType from '../core/blitz/getTreeType';
|
||||||
import resolveTankName from '../core/blitz/resolveTankName';
|
import resolveTankName from '../core/blitz/resolveTankName';
|
||||||
import {
|
import {
|
||||||
|
BlitzkriegTankDefinition,
|
||||||
TIER_ROMAN_NUMERALS,
|
TIER_ROMAN_NUMERALS,
|
||||||
TankDefinition,
|
|
||||||
Tier,
|
Tier,
|
||||||
tankDefinitions,
|
tankDefinitions,
|
||||||
} from '../core/blitzkrieg/definitions/tanks';
|
} from '../core/blitzkrieg/definitions/tanks';
|
||||||
@@ -48,7 +48,7 @@ export const ownedTanksCommand: CommandRegistry = {
|
|||||||
)
|
)
|
||||||
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
).filter((tank) => tank.tankDefinitions?.tier === tier);
|
||||||
const clanAccountInfo = await getClanAccountInfo(server, id, ['clan']);
|
const clanAccountInfo = await getClanAccountInfo(server, id, ['clan']);
|
||||||
const groupedTanks: Record<string, TankDefinition[]> = {};
|
const groupedTanks: Record<string, BlitzkriegTankDefinition[]> = {};
|
||||||
const nations: string[] = [];
|
const nations: string[] = [];
|
||||||
|
|
||||||
filteredTanks.forEach((tank) => {
|
filteredTanks.forEach((tank) => {
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ export async function readXMLDVPL<Type>(file: string) {
|
|||||||
const parser = new XMLParser();
|
const parser = new XMLParser();
|
||||||
const xml = await readStringDVPL(file);
|
const xml = await readStringDVPL(file);
|
||||||
|
|
||||||
return parser.parse(xml).root as Type;
|
return parser.parse(xml) as Type;
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
import { NATION_IDS } from '../../constants/nations';
|
||||||
|
|
||||||
|
export function toUniqueId(nation: string, id: number) {
|
||||||
|
return (id << 8) + (NATION_IDS[nation] << 4) + 1;
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
export interface BlitzkriegGunDefinition {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
tier: number;
|
||||||
|
pitch: [number, number];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type BlitzkriegGunDefinitions = Record<number, BlitzkriegGunDefinition>;
|
||||||
@@ -2,27 +2,31 @@ import { deburr } from 'lodash';
|
|||||||
import { TankType, TreeTypeString } from '../../../components/Tanks';
|
import { TankType, TreeTypeString } from '../../../components/Tanks';
|
||||||
import { asset } from '../asset';
|
import { asset } from '../asset';
|
||||||
|
|
||||||
export interface TankDefinition {
|
export interface BlitzkriegTankDefinition {
|
||||||
id: number;
|
id: number;
|
||||||
nation: string;
|
nation: string;
|
||||||
name: string;
|
name: string;
|
||||||
name_short?: string;
|
|
||||||
tree_type: TreeTypeString;
|
tree_type: TreeTypeString;
|
||||||
tier: Tier;
|
tier: Tier;
|
||||||
type: TankType;
|
type: TankType;
|
||||||
testing?: boolean;
|
testing?: boolean;
|
||||||
|
turrets: number[];
|
||||||
}
|
}
|
||||||
|
export type BlitzkriegTankDefinitions = Record<
|
||||||
export type TankDefinitions = Record<number, TankDefinition>;
|
number,
|
||||||
|
BlitzkriegTankDefinition
|
||||||
|
>;
|
||||||
|
|
||||||
export const tankDefinitions = fetch(asset('definitions/tanks.json'), {
|
export const tankDefinitions = fetch(asset('definitions/tanks.json'), {
|
||||||
cache: 'no-cache',
|
cache: 'no-cache',
|
||||||
}).then(async (response) => response.json() as Promise<TankDefinitions>);
|
}).then(
|
||||||
|
async (response) => response.json() as Promise<BlitzkriegTankDefinitions>,
|
||||||
|
);
|
||||||
|
|
||||||
const entries = new Promise<TankDefinition[]>(async (resolve) => {
|
const entries = new Promise<BlitzkriegTankDefinition[]>(async (resolve) => {
|
||||||
resolve(Object.entries(await tankDefinitions).map(([, entry]) => entry));
|
resolve(Object.entries(await tankDefinitions).map(([, entry]) => entry));
|
||||||
});
|
});
|
||||||
export const tanksDefinitionsArray = new Promise<TankDefinition[]>(
|
export const tanksDefinitionsArray = new Promise<BlitzkriegTankDefinition[]>(
|
||||||
async (resolve) => {
|
async (resolve) => {
|
||||||
resolve((await entries).map((entry) => entry));
|
resolve((await entries).map((entry) => entry));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
export interface BlitzkriegTurretDefinition {
|
||||||
|
id: number;
|
||||||
|
name: string;
|
||||||
|
tier: number;
|
||||||
|
yaw: [number, number];
|
||||||
|
guns: number[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export type BlitzkriegTurretDefinitions = Record<
|
||||||
|
number,
|
||||||
|
BlitzkriegTurretDefinition
|
||||||
|
>;
|
||||||
Reference in new issue
Block a user