Skip to content
You're reading the docs for Railroader 0.6 (the MoW Update), currently available on the Experimental branch.

Passenger Stop

PassengerStop wraps a passenger station — a depot with a pool of waiting passengers bound for other stops. It tracks how many people are waiting for each destination, but not the passengers actually riding a train; that’s Car’s addPassengers/removePassengers/getPassengerCount, which manage the manifest aboard a single passenger car. Use PassengerStop to inspect or nudge the waiting pool at a station, and Car to move passengers on and off a train once it arrives.

Returned by world.getPassengerStop(stationId).

var stop = world.getPassengerStop("dillsboro")
print("\(stop.name) has \(stop.getPassengersWaiting("sylva")) waiting for Sylva")

identifier

string

The stop’s unique identifier, e.g. "dillsboro".

name

string

The stop’s display name, e.g. "Dillsboro Depot".

destinationId string Identifier of the destination passenger stop

Returns the number of passengers currently waiting at this stop for destinationId.

destinationId string Identifier of the destination passenger stop
originId string Identifier of the origin passenger stop for this group of waiting passengers
offset int Count to add (or, if negative, remove) from the waiting count

Adjusts the number of passengers waiting at this stop bound for destinationId, crediting the group to originId. This writes to the stop’s host-authoritative waiting-passenger state, so it only takes effect when called on the host.

Fractional passengers are not supported. offset is floored toward zero before being applied.

var stop = world.getPassengerStop("dillsboro")
stop.offsetPassengersWaiting("sylva", stop.identifier, 5)