feat: use new tankopedia

This commit is contained in:
TrèsAbhi committed 2023-11-29 12:17:21 -06:00
1 parent c5214f8d89
commit bdc7132337
20 files changed
+78 -74

No files matched your search

+3 -3
View File
@@ -1,11 +1,11 @@
import { TreeTypeEnum } from '../../components/Tanks';
import { tankopedia } from '../blitzstars/tankopedia';
import { tankopedia } from '../blitzkrieg/tankopedia';
export default async function getTreeType(id: number) {
const entry = (await tankopedia)[id];
if (entry?.is_collectible) return TreeTypeEnum.Collector;
if (entry?.is_premium) return TreeTypeEnum.Premium;
if (entry.tree_type === 'collector') return TreeTypeEnum.Collector;
if (entry.tree_type === 'premium') return TreeTypeEnum.Premium;
return TreeTypeEnum.TechTree;
}
+2 -2
View File
@@ -1,6 +1,6 @@
import { go } from 'fuzzysort';
import { TANKS, tankopedia } from '../blitzkrieg/tankopedia';
import { UserError } from '../blitzkrieg/userError';
import { TANKS, tankopedia } from '../blitzstars/tankopedia';
export default async function resolveTankId(tank: string | number) {
const number = typeof tank === 'string' ? parseInt(tank) : tank;
@@ -16,7 +16,7 @@ export default async function resolveTankId(tank: string | number) {
cause: `Could not find tank by the name "${tank}".`,
});
} else {
return searchResult[0].obj.tank_id;
return searchResult[0].obj.id;
}
} else {
if ((await tankopedia)[number]) {
+1 -1
View File
@@ -1,4 +1,4 @@
import { tankopedia } from '../blitzstars/tankopedia';
import { tankopedia } from '../blitzkrieg/tankopedia';
export default async function resolveTankName(tankId: number) {
const tankopediaName = (await tankopedia)[tankId]?.name;