chore(generator): removed additional cargo for intermodals; added new vehicle api types

This commit is contained in:
2026-04-04 21:03:33 +02:00
parent 97ce0febec
commit a37c9916b5
7 changed files with 78 additions and 108 deletions
+13 -12
View File
@@ -1,7 +1,7 @@
import { defineComponent } from 'vue';
import { useStore } from '../store';
import { ICarWagon, ILocomotive, IStock, ICargo, IVehicle } from '../types/common.types';
import { additionalCargoTypes, isTractionUnit } from '../utils/vehicleUtils';
import { isTractionUnit } from '../utils/vehicleUtils';
export default defineComponent({
setup() {
@@ -75,21 +75,22 @@ export default defineComponent({
this.store.isDoubleManned = spawnProps.includes('d');
}
} else {
const [carType, ...cargo] = type.split(':');
const [carType, cargo] = type.split(':');
vehicle = this.store.carDataList.find((car) => car.type == carType) || null;
if (vehicle && cargo.length > 0) {
if (/412Z|627Z/.test(vehicle.constructionType)) {
const additionalCargo = additionalCargoTypes.find(
(c) => c.groupType == vehicle!.constructionType && c.cargoStringVariations.includes(cargo.join(':'))
);
if (cargo) {
vehicleCargo = vehicle?.cargoTypes.find((c) => c.id == cargo) || null;
if (additionalCargo) {
cargo[0] = additionalCargo.id;
}
}
// UNUSED - ADDITIONAL INTERMODAL CARGO TEST
// if (/412Z|627Z/.test(vehicle.constructionType)) {
// const additionalCargo = additionalCargoTypes.find(
// (c) => c.groupType == vehicle!.constructionType && c.cargoStringVariations.includes(cargo.join(':'))
// );
vehicleCargo = vehicle?.cargoTypes.find((c) => c.id == cargo[0]) || null;
// if (additionalCargo) {
// cargo[0] = additionalCargo.id;
// }
// }
}
}