Codechange: remove loaded_at_xy from CargoPacket as it was unused (#11276)
This commit is contained in:
@@ -34,13 +34,6 @@ template <class Tinst, class Tcont> class CargoList;
|
||||
class StationCargoList; // forward-declare, so we can use it in VehicleCargoList.
|
||||
extern SaveLoadTable GetCargoPacketDesc();
|
||||
|
||||
/**
|
||||
* To make alignment in the union in CargoPacket a bit easier, create a new type
|
||||
* that is a StationID, but stored as 32bit.
|
||||
*/
|
||||
typedef uint32_t StationID_32bit;
|
||||
static_assert(sizeof(TileIndex) == sizeof(StationID_32bit));
|
||||
|
||||
/**
|
||||
* Container for cargo from the same location and time.
|
||||
*/
|
||||
@@ -50,10 +43,7 @@ private:
|
||||
uint16_t periods_in_transit; ///< Amount of cargo aging periods this packet has been in transit.
|
||||
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).
|
||||
union {
|
||||
TileIndex 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 next_station; ///< Station where the cargo wants to go next.
|
||||
SourceID source_id; ///< Index of source, INVALID_SOURCE if unknown/invalid.
|
||||
StationID source; ///< The station where the cargo came from first.
|
||||
SourceType source_type; ///< Type of \c source_id.
|
||||
@@ -70,7 +60,7 @@ public:
|
||||
|
||||
CargoPacket();
|
||||
CargoPacket(StationID source, TileIndex source_xy, uint16_t count, SourceType source_type, SourceID source_id);
|
||||
CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID source, TileIndex source_xy, TileIndex loaded_at_xy, Money feeder_share = 0, SourceType source_type = SourceType::Industry, SourceID source_id = INVALID_SOURCE);
|
||||
CargoPacket(uint16_t count, uint16_t periods_in_transit, StationID source, TileIndex source_xy, Money feeder_share = 0, SourceType source_type = SourceType::Industry, SourceID source_id = INVALID_SOURCE);
|
||||
|
||||
/** Destroy the packet. */
|
||||
~CargoPacket() { }
|
||||
@@ -79,12 +69,6 @@ public:
|
||||
void Merge(CargoPacket *cp);
|
||||
void Reduce(uint count);
|
||||
|
||||
/**
|
||||
* Sets the tile where the packet was loaded last.
|
||||
* @param load_place Tile where the packet was loaded last.
|
||||
*/
|
||||
void SetLoadPlace(TileIndex load_place) { this->loaded_at_xy = load_place; }
|
||||
|
||||
/**
|
||||
* Sets the station where the packet is supposed to go next.
|
||||
* @param next_station Next station the packet should go to.
|
||||
@@ -175,15 +159,6 @@ public:
|
||||
return this->source_xy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the coordinates of the cargo's last loading station.
|
||||
* @return Last loading station's coordinates.
|
||||
*/
|
||||
inline TileIndex LoadedAtXY() const
|
||||
{
|
||||
return this->loaded_at_xy;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ID of station the cargo wants to go next.
|
||||
* @return Next station for this packets.
|
||||
@@ -401,8 +376,6 @@ public:
|
||||
|
||||
void InvalidateCache();
|
||||
|
||||
void SetTransferLoadPlace(TileIndex xy);
|
||||
|
||||
bool Stage(bool accepted, StationID current_station, StationIDStack next_station, uint8_t order_flags, const GoodsEntry *ge, CargoPayment *payment);
|
||||
|
||||
/**
|
||||
@@ -440,8 +413,7 @@ public:
|
||||
return cp1->source_xy == cp2->source_xy &&
|
||||
cp1->periods_in_transit == cp2->periods_in_transit &&
|
||||
cp1->source_type == cp2->source_type &&
|
||||
cp1->source_id == cp2->source_id &&
|
||||
cp1->loaded_at_xy == cp2->loaded_at_xy;
|
||||
cp1->source_id == cp2->source_id;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -538,8 +510,8 @@ public:
|
||||
* amount of cargo to be moved. Second parameter is destination (if
|
||||
* applicable), return value is amount of cargo actually moved. */
|
||||
|
||||
uint Reserve(uint max_move, VehicleCargoList *dest, TileIndex load_place, StationIDStack next);
|
||||
uint Load(uint max_move, VehicleCargoList *dest, TileIndex load_place, StationIDStack next);
|
||||
uint Reserve(uint max_move, VehicleCargoList *dest, StationIDStack next);
|
||||
uint Load(uint max_move, VehicleCargoList *dest, StationIDStack next);
|
||||
uint Truncate(uint max_move = UINT_MAX, StationCargoAmountMap *cargo_per_source = nullptr);
|
||||
uint Reroute(uint max_move, StationCargoList *dest, StationID avoid, StationID avoid2, const GoodsEntry *ge);
|
||||
|
||||
|
Reference in New Issue
Block a user