mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 12:09:51 +02:00
feat: load tank data
This commit is contained in:
1 parent
6a958da390
commit
383d3a36ef
3 files changed
+39
-1
No files matched your search
@@ -78,7 +78,12 @@ export class ServerAPI extends AbstractAPI {
|
||||
|
||||
for (const item of group) {
|
||||
const tankCatalog = item.TankCatalog();
|
||||
const name = strings[tankCatalog.name!.value];
|
||||
|
||||
if (!tankCatalog.name) continue;
|
||||
|
||||
const name = strings[tankCatalog.name.value];
|
||||
|
||||
if (!name) continue;
|
||||
|
||||
const id = item.name;
|
||||
const slug = sluggify(name);
|
||||
@@ -88,4 +93,11 @@ export class ServerAPI extends AbstractAPI {
|
||||
|
||||
return { tanks };
|
||||
}
|
||||
|
||||
async tank(id: string) {
|
||||
const item = this.metadata.item(`TankEntity.${id}`);
|
||||
const tankCatalog = item.TankCatalog();
|
||||
|
||||
return tankCatalog;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user