OpenTTD Source 20241224-master-gf74b0cf984
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
24struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> {
25 /* CargoPaymentID index member of CargoPaymentPool is 4 bytes. */
26 StationID current_station;
28
33
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.
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.
CargoPayment()
Constructor for pool saveload.
Company * owner
NOSAVE: The owner of the vehicle.
Money PayTransfer(CargoID cargo, const CargoPacket *cp, uint count, TileIndex current_tile)
Handle payment for transfer of the given cargo packet.
Definition economy.cpp:1258
StationID current_station
NOSAVE: The current station.
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:1236
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.
Definition pool_type.hpp:80
Vehicle data structure.