mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
Poprawki funkcjonalności
This commit is contained in:
@@ -1,22 +0,0 @@
|
||||
import { EVehicleUseType } from "../enums/EVehicleUseType";
|
||||
import { IStock } from "../types";
|
||||
|
||||
export const verifyTrainSpec = (stockList: IStock[], vehicleMass: number, vehicleUseType: string) => {
|
||||
const hasHeadLoco = stockList.length > 0
|
||||
&& (stockList[0].useType == EVehicleUseType.LOCO_ELECTRICAL
|
||||
|| stockList[0].useType == EVehicleUseType.LOCO_DIESEL);
|
||||
|
||||
if (!hasHeadLoco) return;
|
||||
|
||||
const headLoco = stockList[0];
|
||||
const carList = stockList.filter(stock => !stock.isLoco);
|
||||
|
||||
|
||||
|
||||
const isTrainPassenger = carList.length != 0
|
||||
? carList.every(stock => stock.useType == EVehicleUseType.CAR_PASSENGER)
|
||||
&& vehicleUseType == EVehicleUseType.CAR_PASSENGER
|
||||
: false;
|
||||
|
||||
|
||||
}
|
||||
@@ -103,7 +103,7 @@ export function carDataList(state: IStore) {
|
||||
const carPropsData = vehiclePropsJSON.find((v) => car[0].toString().includes(v.type));
|
||||
|
||||
acc.push({
|
||||
useType: vehicleTypeKey,
|
||||
useType: vehicleTypeKey as 'car-passenger' | 'car-cargo',
|
||||
type: car[0] as string,
|
||||
constructionType: car[1] as string,
|
||||
loadable: car[2] as boolean,
|
||||
|
||||
Reference in New Issue
Block a user