#include <cargopacket.h>
Public Member Functions | |
CargoPacket (StationID source=INVALID_STATION, uint16 count=0) | |
Creates a new cargo packet. | |
virtual | ~CargoPacket () |
Destroy the packet. | |
bool | IsValid () const |
Is this a valid cargo packet ? | |
bool | SameSource (const CargoPacket *cp) const |
Checks whether the cargo packet is from (exactly) the same source in time and location. | |
Data Fields | |
Money | feeder_share |
Value of feeder pickup to be paid for on delivery of cargo. | |
TileIndex | source_xy |
The origin of the cargo (first station in feeder chain). | |
TileIndex | loaded_at_xy |
Location where this cargo has been loaded into the vehicle. | |
StationID | source |
The station where the cargo came from first. | |
uint16 | count |
The amount of cargo in this packet. | |
byte | days_in_transit |
Amount of days this packet has been in transit. | |
bool | paid_for |
Have we been paid for this cargo packet? |
Container for cargo from the same location and time
Definition at line 24 of file cargopacket.h.
CargoPacket::CargoPacket | ( | StationID | source = INVALID_STATION , |
|
uint16 | count = 0 | |||
) |
Creates a new cargo packet.
source | the source of the packet | |
count | the number of cargo entities to put in this packet |
Definition at line 19 of file cargopacket.cpp.
References days_in_transit, feeder_share, loaded_at_xy, paid_for, and source_xy.
bool CargoPacket::IsValid | ( | ) | const [inline] |
Is this a valid cargo packet ?
Definition at line 50 of file cargopacket.h.
Referenced by CargoList::Append().
bool CargoPacket::SameSource | ( | const CargoPacket * | cp | ) | const |
Checks whether the cargo packet is from (exactly) the same source in time and location.
cp | the cargo packet to compare to |
Definition at line 38 of file cargopacket.cpp.
References days_in_transit, paid_for, and source_xy.