added double manning checkbox & support

This commit is contained in:
2023-10-28 15:33:09 +02:00
parent bea3c59405
commit c25a55a7d9
10 changed files with 70 additions and 38 deletions
+19
View File
@@ -22,6 +22,7 @@ export const useStore = defineStore({
chosenVehicle: null,
isColdStart: false,
isDoubleManned: false,
showSupporter: false,
imageLoading: false,
@@ -61,6 +62,24 @@ export const useStore = defineStore({
isTrainPassenger: (state) => isTrainPassenger(state),
chosenRealStock: (state) => chosenRealStock(state),
acceptableMass: (state) => acceptableMass(state),
stockSupportsColdStart: (state) => {
if (state.stockList.length == 0) return false;
if (!state.stockList[0].isLoco) return false;
const headingLoco = state.stockList[0];
return state.stockData?.props.find((stock) => stock.type == headingLoco.constructionType)?.coldStart ?? false;
},
stockSupportsDoubleManning: (state) => {
if (state.stockList.length == 0) return false;
if (!state.stockList[0].isLoco) return false;
const headingLoco = state.stockList[0];
return state.stockData?.props.find((stock) => stock.type == headingLoco.constructionType)?.doubleManned ?? false;
},
},
actions: {