Rename getArrivedStopIfExists to getArrivedStopIfNextStop, and add more documentation

This commit is contained in:
2025-11-21 11:42:42 -08:00
parent 715bef163c
commit ee10daf957
4 changed files with 33 additions and 31 deletions

View File

@@ -3,13 +3,13 @@ import { ShuttleGetterSetterRepository } from "./ShuttleGetterSetterRepository";
import { IOrderedStop, IRoute, IShuttle, IStop, shuttleHasArrivedAtStop } from "../../entities/ShuttleRepositoryEntities";
import { IEntityWithId } from "../../entities/SharedEntities";
import {
ShuttleRepositoryEvent,
ShuttleRepositoryEventListener,
ShuttleRepositoryEventName,
ShuttleRepositoryEventPayloads,
ShuttleStopArrival,
ShuttleTravelTimeDataIdentifier,
ShuttleTravelTimeDateFilterArguments,
ShuttleRepositoryEvent,
ShuttleRepositoryEventListener,
ShuttleRepositoryEventName,
ShuttleRepositoryEventPayloads,
ShuttleStopArrival,
ShuttleTravelTimeDataIdentifier,
ShuttleTravelTimeDateFilterArguments,
} from "./ShuttleGetterRepository";
/**
@@ -190,9 +190,9 @@ export class UnoptimizedInMemoryShuttleRepository
if (isAtStop) {
// Allow retrieval of the shuttle's current stop
// Will still return undefined when the shuttle leaves the stop
arrivedStop = await this.getArrivedStopIfExists(shuttle, true);
arrivedStop = await this.getArrivedStopIfNextStop(shuttle, true);
} else {
arrivedStop = await this.getArrivedStopIfExists(shuttle, false);
arrivedStop = await this.getArrivedStopIfNextStop(shuttle, false);
}
@@ -268,7 +268,7 @@ export class UnoptimizedInMemoryShuttleRepository
return sum / filteredPoints.length;
}
public async getArrivedStopIfExists(
public async getArrivedStopIfNextStop(
shuttle: IShuttle,
canReturnShuttleCurrentStop: boolean = false,
): Promise<IStop | undefined> {