OpenTTD Source  20241108-master-g80f628063a
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 #include "company_type.h"
15 
20 
24 struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> {
25  /* CargoPaymentID index member of CargoPaymentPool is 4 bytes. */
26  StationID current_station;
28 
33 
37  ~CargoPayment();
38 
39  Money PayTransfer(CargoID cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
40  void PayFinalDelivery(CargoID cargo, const CargoPacket *cp, uint count, TileIndex current_tile);
41 };
42 
43 #endif /* ECONOMY_BASE_H */
uint8_t CargoID
Cargo slots to indicate a cargo type within a game.
Definition: cargo_type.h:22
Base class for cargo packets.
Types related to companies.
Pool< CargoPayment, CargoPaymentID, 512, 0xFF000 > CargoPaymentPool
Type of pool to store cargo payments in; little over 1 million.
Definition: economy_base.h:17
CargoPaymentPool _cargo_payment_pool
The actual pool to store cargo payments in.
Container for cargo from the same location and time.
Definition: cargopacket.h:40
Helper class to perform the cargo payment.
Definition: economy_base.h:24
CargoPayment()
Constructor for pool saveload.
Definition: economy_base.h:35
Company * owner
NOSAVE: The owner of the vehicle.
Definition: economy_base.h:27
Money PayTransfer(CargoID cargo, const CargoPacket *cp, uint count, TileIndex current_tile)
Handle payment for transfer of the given cargo packet.
Definition: economy.cpp:1261
StationID current_station
NOSAVE: The current station.
Definition: economy_base.h:26
void PayFinalDelivery(CargoID cargo, const CargoPacket *cp, uint count, TileIndex current_tile)
Handle payment for final delivery of the given cargo packet.
Definition: economy.cpp:1239
Vehicle * front
The front vehicle to do the payment of.
Definition: economy_base.h:29
Money visual_transfer
The transfer credits to be shown.
Definition: economy_base.h:32
Money visual_profit
The visual profit to show.
Definition: economy_base.h:31
Money route_profit
The amount of money to add/remove from the bank account.
Definition: economy_base.h:30
Base class for all PoolItems.
Definition: pool_type.hpp:237
Base class for all pools.
Definition: pool_type.hpp:80
Vehicle data structure.
Definition: vehicle_base.h:244