economy_base.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00012 #ifndef ECONOMY_BASE_H
00013 #define ECONOMY_BASE_H
00014
00015 #include "cargopacket.h"
00016 #include "company_type.h"
00017
00019 typedef Pool<CargoPayment, CargoPaymentID, 512, 0xFF000> CargoPaymentPool;
00021 extern CargoPaymentPool _cargo_payment_pool;
00022
00026 struct CargoPayment : CargoPaymentPool::PoolItem<&_cargo_payment_pool> {
00027 Vehicle *front;
00028 Money route_profit;
00029 Money visual_profit;
00030
00031
00032 Company *owner;
00033 StationID current_station;
00034 CargoID ct;
00035
00037 CargoPayment() {}
00038 CargoPayment(Vehicle *front);
00039 ~CargoPayment();
00040
00041 Money PayTransfer(const CargoPacket *cp, uint count);
00042 void PayFinalDelivery(const CargoPacket *cp, uint count);
00043
00048 void SetCargo(CargoID ct) { this->ct = ct; }
00049 };
00050
00051 #define FOR_ALL_CARGO_PAYMENTS_FROM(var, start) FOR_ALL_ITEMS_FROM(CargoPayment, cargo_payment_index, var, start)
00052 #define FOR_ALL_CARGO_PAYMENTS(var) FOR_ALL_CARGO_PAYMENTS_FROM(var, 0)
00053
00054 #endif