mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 07:50:31 +00:00
Rename getArrivedStopIfExists to getArrivedStopIfNextStop, and add more documentation
This commit is contained in:
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user