feat: tree type

This commit is contained in:
TrèsAbhi committed 2023-11-27 12:26:51 -06:00
1 parent ca463a0f0e
commit 3cf81afc4a
1 file changed
+9 -6
+9 -6
View File
@@ -3,6 +3,7 @@ import { load } from 'js-yaml';
import { argv } from 'process'; import { argv } from 'process';
import { ElementCompact, xml2js } from 'xml-js'; import { ElementCompact, xml2js } from 'xml-js';
import { parse } from 'yaml'; import { parse } from 'yaml';
import { TreeTypeString } from '../src/components/Tanks';
import { NATION_IDS } from '../src/constants/nations'; import { NATION_IDS } from '../src/constants/nations';
const VEHICLE_DEFS = 'assets/Data/XML/item_defs/vehicles'; const VEHICLE_DEFS = 'assets/Data/XML/item_defs/vehicles';
@@ -42,8 +43,7 @@ interface BlitzkriegTankopedia {
nation: string; nation: string;
name: string; name: string;
name_short?: string; name_short?: string;
is_premium: boolean; tree_type: TreeTypeString;
is_collector: boolean;
tier: number; tier: number;
type: string; type: string;
} }
@@ -74,8 +74,8 @@ Promise.all(
// TODO: use userString property instead // TODO: use userString property instead
const name = strings[`#${nation}_vehicles:${vehicle}`]; const name = strings[`#${nation}_vehicles:${vehicle}`];
const name_short = strings[`#${nation}_vehicles:${vehicle}_short`]; const name_short = strings[`#${nation}_vehicles:${vehicle}_short`];
const is_premium = 'gold' in vehicleData.price; const isPremium = 'gold' in vehicleData.price;
const is_collector = vehicleData.sellPrice const isCollector = vehicleData.sellPrice
? 'gold' in vehicleData.sellPrice ? 'gold' in vehicleData.sellPrice
: false; : false;
const tier = parseInt(vehicleData.level._text); const tier = parseInt(vehicleData.level._text);
@@ -87,8 +87,11 @@ Promise.all(
name, name,
name_short, name_short,
nation, nation,
is_premium, tree_type: isCollector
is_collector, ? 'collector'
: isPremium
? 'premium'
: 'tech-tree',
tier, tier,
type, type,
}; };