feature fix: akceptowalna masa składu

This commit is contained in:
2023-02-19 22:55:38 +01:00
parent 7ea7ad5da2
commit ebf6567e88
5 changed files with 77 additions and 187 deletions
+1 -26
View File
@@ -18,32 +18,7 @@ export default defineComponent({
},
trainTooHeavy() {
const totalMass = this.store.totalMass;
const isTrainPassenger = this.store.isTrainPassenger;
const stockList = this.store.stockList;
if (stockList.length == 0 || !stockList[0].isLoco) return false;
const activeLocomotiveType = stockList[0].type;
// Spalinowy SM
if (/^SM/.test(activeLocomotiveType) && totalMass > 2400) return true;
// Elektryczne EU07 / EP07 / EP08 / ET41
// Pasażerski elektr.
if (isTrainPassenger) {
if (/^(EU|EP)/.test(activeLocomotiveType) && totalMass > 650) return true;
if (/^ET/.test(activeLocomotiveType) && totalMass > 700) return true;
return false;
}
// Towarowy / inny elektr.
if (/^EU/.test(activeLocomotiveType) && totalMass > 2000) return true;
if (/^ET/.test(activeLocomotiveType) && totalMass > 4000) return true;
return false;
return this.store.acceptableMass && this.store.totalMass > this.store.acceptableMass;
},
locoNotSuitable() {