@ -43,11 +43,16 @@ namespace upstream_sl {
class SlStationGoods ;
}
typedef uint32 TileOrStationID ;
void ClearCargoPacketDeferredPayments ( ) ;
void ChangeOwnershipOfCargoPacketDeferredPayments ( Owner old_owner , Owner new_owner ) ;
/**
* To make alignment in the union in CargoPacket a bit easier , create a new type
* that is a StationID , but stored as 32 bit .
*/
typedef uint32_t StationID_32bit ;
static_assert ( sizeof ( TileIndex ) = = sizeof ( StationID_32bit ) ) ;
/**
* Container for cargo from the same location and time .
*/
@ -59,8 +64,8 @@ private:
SourceID source_id ; ///< Index of source, INVALID_SOURCE if unknown/invalid.
TileIndex source_xy ; ///< The origin of the cargo (first station in feeder chain).
union {
Tile OrStationID loaded_at_xy ; ///< Location where this cargo has been loaded into the vehicle.
TileOr StationID next_station ; ///< Station where the cargo wants to go next.
Tile Index loaded_at_xy ; ///< Location where this cargo has been loaded into the vehicle.
StationID_32bit next_station ; ///< Station where the cargo wants to go next.
} ;
StationID source ; ///< The station where the cargo came from first.
SourceType source_type ; ///< Type of \c source_id.
@ -467,7 +472,7 @@ public:
* applicable ) , return value is amount of cargo actually moved . */
template < MoveToAction Tfrom , MoveToAction Tto >
uint Reassign ( uint max_move , TileOr StationID update = INVALID_ TILE ) ;
uint Reassign ( uint max_move , StationID update = INVALID_ STATION ) ;
uint Return ( uint max_move , StationCargoList * dest , StationID next_station ) ;
uint Unload ( uint max_move , StationCargoList * dest , CargoPayment * payment ) ;
uint Shift ( uint max_move , VehicleCargoList * dest ) ;