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

Waybill

A Waybill describes a car’s current freight assignment (origin, destination, payment). It has value semantics: comparing or copying a Waybill compares/copies the assignment, not a reference.

Read or set via a Car’s waybill property.

ConstructorDescription
Waybill(created, origin, destination, payment, completed, tag, graceDays)created (float, game time in seconds when the waybill was issued), origin (string identifier or null), destination (string identifier), payment (int), completed (bool), tag (string or null), graceDays (int)
var wb = Waybill(world.gameTime, null, "some-industry", 500, false, null, 0)

completed

bool

true if this waybill has been completed. The car may not still be at its destination.

destination

string

Identifier of the industry/car position this waybill is destined for.

graceDays

int

Extra days allowed for delivery performance before a lateness penalty applies. 0 for none.

origin

string?

Identifier of the industry/car position this waybill originated from, or null if it has none.

Payment for delivering the car, in dollars. Zero if the waybill has already been paid.

tag

string?

Optional tag for recognizing a waybill association, or null if unset. Tags are defined by whatever created the waybill — for example, an industry tracking a specific ordered load.

Interpolating a Waybill (or calling print() on one) formats it with all of its fields:

print("Waybill: \(car.waybill)")
// Waybill: Created = ..., Origin = ..., Destination = some-industry, Payment = 500, Completed = False, Tag = , GraceDays = 0