mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 19:48:11 +00:00
added double manning checkbox & support
This commit is contained in:
@@ -1,7 +0,0 @@
|
||||
const supportedConstructions = ["303e", "203e"];
|
||||
|
||||
export function locoSupportsColdStart(constructionType: string) {
|
||||
return new RegExp(`(${supportedConstructions.join("|")})`).test(
|
||||
constructionType,
|
||||
);
|
||||
}
|
||||
@@ -16,5 +16,7 @@ export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: num
|
||||
}
|
||||
|
||||
export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) {
|
||||
if(massLimits[locoType] === undefined) return 0;
|
||||
|
||||
return massLimits[locoType][isTrainPassenger ? 0 : 1] || 0;
|
||||
}
|
||||
|
||||
@@ -33,8 +33,11 @@ export function locoDataList(state: IStore) {
|
||||
sponsorsOnlyTimestamp: Number(sponsorsTimestamp),
|
||||
imageSrc: '',
|
||||
|
||||
length: locoProps?.length && type.startsWith('2EN') ? locoProps.length * 2 : locoProps?.length || 0,
|
||||
mass: locoProps?.mass && type.startsWith('2EN') ? 253 : locoProps?.mass || 0,
|
||||
length: locoProps?.length && type.startsWith('2EN') ? locoProps.length * 2 : locoProps?.length ?? 0,
|
||||
mass: locoProps?.mass && type.startsWith('2EN') ? 253 : locoProps?.mass ?? 0,
|
||||
|
||||
coldStart: locoProps?.coldStart ?? false,
|
||||
doubleManned: locoProps?.doubleManned ?? false,
|
||||
});
|
||||
});
|
||||
|
||||
@@ -70,12 +73,10 @@ export function carDataList(state: IStore) {
|
||||
maxSpeed: Number(maxSpeed),
|
||||
imageSrc: '',
|
||||
cargoList:
|
||||
!carPropsData || carPropsData.cargo === null
|
||||
? []
|
||||
: carPropsData.cargo.split(';').map((cargo) => ({
|
||||
id: cargo.split(':')[0],
|
||||
totalMass: Number(cargo.split(':')[1]),
|
||||
})),
|
||||
carPropsData?.cargo?.split(';').map((cargo) => ({
|
||||
id: cargo.split(':')[0],
|
||||
totalMass: Number(cargo.split(':')[1]),
|
||||
})) || [],
|
||||
|
||||
mass: carPropsData?.mass || 0,
|
||||
length: carPropsData?.length || 0,
|
||||
|
||||
Reference in New Issue
Block a user