OpenTTD Source 20250717-master-g1b01a0636c
economy_base.h
Go to the documentation of this file.
1/*
2 * This file is part of OpenTTD.
3 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
4 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
5 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
6 */
7
10#ifndef ECONOMY_BASE_H
11#define ECONOMY_BASE_H
12
13#include "cargopacket.h"
14
19
23struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> {
24 /* CargoPaymentID index member of CargoPaymentPool is 4 bytes. */
25 StationID current_station = StationID::Invalid();
26
27 Vehicle *front = nullptr;
31
36
37 Money PayTransfer(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
38 void PayFinalDelivery(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
39};
40
41#endif /* ECONOMY_BASE_H */
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
Definition cargo_type.h:23
Base class for cargo packets.
CargoPaymentPool _cargo_payment_pool
The actual pool to store cargo payments in.
Container for cargo from the same location and time.
Definition cargopacket.h:41
Helper class to perform the cargo payment.
void PayFinalDelivery(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile)
Handle payment for final delivery of the given cargo packet.
Definition economy.cpp:1216
CargoPayment()
Constructor for pool saveload.
StationID current_station
NOSAVE: The current station.
Money PayTransfer(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile)
Handle payment for transfer of the given cargo packet.
Definition economy.cpp:1234
Vehicle * front
The front vehicle to do the payment of.
Money visual_transfer
The transfer credits to be shown.
Money visual_profit
The visual profit to show.
Money route_profit
The amount of money to add/remove from the bank account.
Base class for all PoolItems.
Base class for all pools.
Vehicle data structure.