|
OpenTTD Source 20260208-master-g43af8e94d0
|
Helper class to perform the cargo payment. More...
#include <economy_base.h>
Public Member Functions | |
| CargoPayment (CargoPaymentID index) | |
| CargoPayment (CargoPaymentID index, Vehicle *front) | |
| Makes us a new cargo payment helper. | |
| Money | PayTransfer (CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile) |
| Handle payment for transfer of the given cargo packet. | |
| void | PayFinalDelivery (CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile) |
| Handle payment for final delivery of the given cargo packet. | |
Data Fields | |
| StationID | current_station = StationID::Invalid() |
| NOSAVE: The current station. | |
| Vehicle * | front = nullptr |
| The front vehicle to do the payment of. | |
| Money | route_profit = 0 |
| The amount of money to add/remove from the bank account. | |
| Money | visual_profit = 0 |
| The visual profit to show. | |
| Money | visual_transfer = 0 |
| The transfer credits to be shown. | |
Helper class to perform the cargo payment.
Definition at line 23 of file economy_base.h.
|
inline |
Definition at line 32 of file economy_base.h.
| CargoPayment::CargoPayment | ( | CargoPaymentID | index, |
| Vehicle * | front ) |
Makes us a new cargo payment helper.
Definition at line 1168 of file economy.cpp.
References _cargo_payment_pool, current_station, and front.
| CargoPayment::~CargoPayment | ( | ) |
Definition at line 1175 of file economy.cpp.
| void CargoPayment::PayFinalDelivery | ( | CargoType | cargo, |
| const CargoPacket * | cp, | ||
| uint | count, | ||
| TileIndex | current_tile ) |
Handle payment for final delivery of the given cargo packet.
| cargo | The cargo type of the cargo. |
| cp | The cargo packet to pay for. |
| count | The number of packets to pay for. |
| current_tile | Current tile the payment is happening on. |
Definition at line 1210 of file economy.cpp.
References current_station, DeliverGoods(), CargoPacket::GetDistance(), CargoPacket::GetFeederShare(), CargoPacket::GetPeriodsInTransit(), CargoPacket::GetSource(), route_profit, and visual_profit.
| Money CargoPayment::PayTransfer | ( | CargoType | cargo, |
| const CargoPacket * | cp, | ||
| uint | count, | ||
| TileIndex | current_tile ) |
Handle payment for transfer of the given cargo packet.
| cargo | The cargo type of the cargo. |
| cp | The cargo packet to pay for; actual payment won't be made!. |
| count | The number of packets to pay for. |
| current_tile | Current tile the payment is happening on. |
Definition at line 1228 of file economy.cpp.
References _settings_game, CargoPacket::GetDistance(), CargoPacket::GetFeederShare(), CargoPacket::GetPeriodsInTransit(), and visual_transfer.
Referenced by VehicleCargoList::Stage().
| StationID CargoPayment::current_station = StationID::Invalid() |
NOSAVE: The current station.
Definition at line 25 of file economy_base.h.
Referenced by CargoPayment(), and PayFinalDelivery().
| Vehicle* CargoPayment::front = nullptr |
The front vehicle to do the payment of.
Definition at line 27 of file economy_base.h.
Referenced by CargoPayment().
| Money CargoPayment::route_profit = 0 |
The amount of money to add/remove from the bank account.
Definition at line 28 of file economy_base.h.
Referenced by PayFinalDelivery().
| Money CargoPayment::visual_profit = 0 |
The visual profit to show.
Definition at line 29 of file economy_base.h.
Referenced by PayFinalDelivery().
| Money CargoPayment::visual_transfer = 0 |
The transfer credits to be shown.
Definition at line 30 of file economy_base.h.
Referenced by PayTransfer().