refactor: optimization of train schedules

This commit is contained in:
2024-05-19 19:50:01 +02:00
parent d91d4cc6a8
commit 8417754403
15 changed files with 331 additions and 356 deletions
-1
View File
@@ -161,7 +161,6 @@ export namespace API {
stopNameRAW: string;
stopType: string;
stopDistance: number;
pointId: string;
mainStop: boolean;
+9 -49
View File
@@ -41,7 +41,6 @@ export interface RegionCounters {
export interface Train {
id: string;
trainId: string;
mass: number;
length: number;
speed: number;
@@ -148,8 +147,8 @@ export interface ActiveScenery {
dispatcherStatus: Status.ActiveDispatcher | number;
dispatcherTimestamp: number | null;
isOnline: boolean;
stationTrains?: StationTrain[];
scheduledTrains?: ScheduledTrain[];
stationTrains: Train[];
scheduledTrains: CheckpointTrain[];
scheduledTrainCount: {
all: number;
confirmed: number;
@@ -164,49 +163,6 @@ export interface ScenerySpawn {
spawnType: ScenerySpawnType;
}
export interface StationTrain {
driverName: string;
driverId: number;
trainNo: number;
trainId: string;
stopStatus: string;
}
export interface ScheduledTrain {
checkpointName: string;
trainId: string;
trainNo: number;
driverName: string;
driverId: number;
currentStationName: string;
currentStationHash: string;
category: string;
stopInfo: TrainStop;
terminatesAt: string;
beginsAt: string;
prevStationName: string;
nextStationName: string;
arrivingLine: string | null;
departureLine: string | null;
prevDepartureLine: string | null;
nextArrivalLine: string | null;
signal: string;
connectedTrack: string;
stopLabel: string;
stopStatus: StopStatus;
stopStatusID: number;
region: string;
}
export interface TrainStop {
stopName: string;
stopNameRAW: string;
@@ -223,13 +179,17 @@ export interface TrainStop {
departureTimestamp: number;
departureRealTimestamp: number;
departureDelay: number;
pointId: number;
comments?: string;
beginsHere: boolean;
terminatesHere: boolean;
confirmed: boolean;
stopped: boolean;
confirmed: number;
stopped: number;
stopTime: number | null;
}
export interface CheckpointTrain {
checkpointStop: TrainStop;
train: Train;
}