mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-24 20:19:49 +02:00
(4) some implementation
This commit is contained in:
1 parent
bd7c952478
commit
6ad64c9bd9
2 files changed
+45
-45
No files matched your search
@@ -18,6 +18,7 @@ import {
|
|||||||
EngineDefinitionsList,
|
EngineDefinitionsList,
|
||||||
Equalizer,
|
Equalizer,
|
||||||
EquipmentDefinitions,
|
EquipmentDefinitions,
|
||||||
|
EquipmentSlot,
|
||||||
GunDefinition,
|
GunDefinition,
|
||||||
GunDefinitionsList,
|
GunDefinitionsList,
|
||||||
I18nString,
|
I18nString,
|
||||||
@@ -950,6 +951,20 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Object.values(tankDefinitions.tanks).forEach((tank) => {
|
||||||
|
tank.research_cost = tankXps.get(tank.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
Object.values(tankDefinitions.tanks).forEach((tank) => {
|
||||||
|
tank.successors?.forEach((predecessorId) => {
|
||||||
|
if (
|
||||||
|
!tankDefinitions.tanks[predecessorId].ancestors?.includes(tank.id)
|
||||||
|
) {
|
||||||
|
tankDefinitions.tanks[predecessorId].ancestors?.push(tank.id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return tankDefinitions;
|
return tankDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1301,6 +1316,36 @@ export class ServerBlitzKitAPI extends BlitzKitAPI {
|
|||||||
async equipmentDefinitions() {
|
async equipmentDefinitions() {
|
||||||
const equipmentDefinitions = EquipmentDefinitions.create();
|
const equipmentDefinitions = EquipmentDefinitions.create();
|
||||||
|
|
||||||
|
Object.entries(this.optionalDevices!.root).forEach(
|
||||||
|
([optionalDeviceKey, optionalDeviceEntry]) => {
|
||||||
|
if (optionalDeviceKey === "nextAvailableId") return;
|
||||||
|
|
||||||
|
equipmentDefinitions.equipments[optionalDeviceEntry.id] = {
|
||||||
|
name: this.getString(optionalDeviceEntry.userString),
|
||||||
|
description: this.getString(optionalDeviceEntry.description),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
Object.entries(this.optionalDeviceSlots!.root.presets).forEach(
|
||||||
|
([optionalDeviceSlotKey, optionalDeviceSlotEntry]) => {
|
||||||
|
if (optionalDeviceSlotKey === "emptyPreset") return;
|
||||||
|
|
||||||
|
equipmentDefinitions.presets[optionalDeviceSlotKey] = {
|
||||||
|
slots: Object.values(optionalDeviceSlotEntry)
|
||||||
|
.map((level) => {
|
||||||
|
return Object.values(level).map((options) => {
|
||||||
|
return {
|
||||||
|
left: this.optionalDevices!.root[options.device0].id,
|
||||||
|
right: this.optionalDevices!.root[options.device1].id,
|
||||||
|
} satisfies EquipmentSlot;
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.flat(),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
return equipmentDefinitions;
|
return equipmentDefinitions;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,16 +5,13 @@ import {
|
|||||||
ConsumableDefinitions,
|
ConsumableDefinitions,
|
||||||
ConsumableTankCategoryFilterCategory,
|
ConsumableTankCategoryFilterCategory,
|
||||||
EquipmentDefinitions,
|
EquipmentDefinitions,
|
||||||
EquipmentSlot,
|
|
||||||
MapDefinitions,
|
MapDefinitions,
|
||||||
ModelDefinitions,
|
ModelDefinitions,
|
||||||
Provision,
|
Provision,
|
||||||
ProvisionDefinitions,
|
ProvisionDefinitions,
|
||||||
SkillDefinitions,
|
SkillDefinitions,
|
||||||
TankDefinitions,
|
TankDefinitions,
|
||||||
Vector3,
|
|
||||||
} from "@blitzkit/core";
|
} from "@blitzkit/core";
|
||||||
import type { Vector3Tuple } from "three";
|
|
||||||
|
|
||||||
type BlitzTankFilterDefinitionCategory = "clip";
|
type BlitzTankFilterDefinitionCategory = "clip";
|
||||||
const blitzTankFilterDefinitionCategoryToBlitzkit: Record<
|
const blitzTankFilterDefinitionCategoryToBlitzkit: Record<
|
||||||
@@ -85,48 +82,6 @@ type CombatRolesYaml = Record<
|
|||||||
>;
|
>;
|
||||||
|
|
||||||
export async function definitions() {
|
export async function definitions() {
|
||||||
Object.values(tankDefinitions.tanks).forEach((tank) => {
|
|
||||||
tank.research_cost = tankXps.get(tank.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
Object.values(tankDefinitions.tanks).forEach((tank) => {
|
|
||||||
tank.successors?.forEach((predecessorId) => {
|
|
||||||
if (!tankDefinitions.tanks[predecessorId].ancestors?.includes(tank.id)) {
|
|
||||||
tankDefinitions.tanks[predecessorId].ancestors?.push(tank.id);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
Object.entries(optionalDevices.root).forEach(
|
|
||||||
([optionalDeviceKey, optionalDeviceEntry]) => {
|
|
||||||
if (optionalDeviceKey === "nextAvailableId") return;
|
|
||||||
|
|
||||||
equipmentDefinitions.equipments[optionalDeviceEntry.id] = {
|
|
||||||
name: getString(optionalDeviceEntry.userString),
|
|
||||||
description: getString(optionalDeviceEntry.description),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.entries(optionalDeviceSlots.root.presets).forEach(
|
|
||||||
([optionalDeviceSlotKey, optionalDeviceSlotEntry]) => {
|
|
||||||
if (optionalDeviceSlotKey === "emptyPreset") return;
|
|
||||||
|
|
||||||
equipmentDefinitions.presets[optionalDeviceSlotKey] = {
|
|
||||||
slots: Object.values(optionalDeviceSlotEntry)
|
|
||||||
.map((level) => {
|
|
||||||
return Object.values(level).map((options) => {
|
|
||||||
return {
|
|
||||||
left: optionalDevices.root[options.device0].id,
|
|
||||||
right: optionalDevices.root[options.device1].id,
|
|
||||||
} satisfies EquipmentSlot;
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.flat(),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
);
|
|
||||||
|
|
||||||
Object.entries(consumablesCommon).forEach(([key, consumable]) => {
|
Object.entries(consumablesCommon).forEach(([key, consumable]) => {
|
||||||
const entry: Consumable = {
|
const entry: Consumable = {
|
||||||
id: consumable.id,
|
id: consumable.id,
|
||||||
|
|||||||
Reference in new issue
Block a user