mirror of
https://github.com/Spythere/pojazdownik.git
synced 2026-05-03 05:18:10 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| bd9af9a630 | |||
| 2188dbdf9b | |||
| c4576d7802 |
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "pojazdownik",
|
||||
"version": "1.7.2",
|
||||
"version": "1.7.3",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
|
||||
@@ -5,6 +5,10 @@ export type SpeedLimitLocoType = keyof typeof speedLimits;
|
||||
export type MassLimitLocoType = keyof typeof massLimits;
|
||||
|
||||
export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: number, isTrainPassenger: boolean) {
|
||||
console.log(speedLimits[locoType]);
|
||||
|
||||
if (speedLimits[locoType] === undefined) return 0;
|
||||
|
||||
const speedTable = speedLimits[locoType][isTrainPassenger ? 'passenger' : 'cargo'];
|
||||
|
||||
if (!speedTable) return undefined;
|
||||
@@ -16,7 +20,7 @@ export function calculateSpeedLimit(locoType: SpeedLimitLocoType, stockMass: num
|
||||
}
|
||||
|
||||
export function calculateMassLimit(locoType: MassLimitLocoType, isTrainPassenger: boolean) {
|
||||
if(massLimits[locoType] === undefined) return 0;
|
||||
|
||||
if (massLimits[locoType] === undefined) return 0;
|
||||
|
||||
return massLimits[locoType][isTrainPassenger ? 0 : 1] || 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user