Pass down the new arguments into the shuttle repositories

This commit is contained in:
2025-11-20 16:47:50 -08:00
parent 645fe1055b
commit a9db9b5d5c
3 changed files with 34 additions and 7 deletions

View File

@@ -20,6 +20,14 @@ import {
export class UnoptimizedInMemoryShuttleRepository
extends EventEmitter
implements ShuttleGetterSetterRepository {
constructor(
readonly shuttleStopArrivalDegreeDelta: number = 0.001,
readonly shuttleStopNearbyDegreeDelta: number = 0.003,
) {
super()
}
public override on<T extends ShuttleRepositoryEventName>(
event: T,
listener: ShuttleRepositoryEventListener<T>,
@@ -252,8 +260,8 @@ export class UnoptimizedInMemoryShuttleRepository
public async getArrivedStopIfExists(
shuttle: IShuttle,
delta = 0.001,
): Promise<IStop | undefined> {
const delta = this.shuttleStopArrivalDegreeDelta;
const orderedStops = await this.getOrderedStopsByRouteId(shuttle.routeId);
for (const orderedStop of orderedStops) {