OpenTTD Source 20260108-master-g8ba1860eaa
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 <https://www.gnu.org/licenses/old-licenses/gpl-2.0>.
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
35
36 Money PayTransfer(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
37 void PayFinalDelivery(CargoType cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
38};
39
40#endif /* ECONOMY_BASE_H */
uint8_t CargoType
Cargo slots to indicate a cargo type within a game.
Definition cargo_type.h:21
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:1210
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:1228
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.
PoolItem(Tindex index)
Construct the item.
const Tindex index
Index of this pool item.
Base class for all pools.
Vehicle data structure.