summaryrefslogtreecommitdiff
path: root/src/cargoaction.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-02-17 14:54:50 +0000
committerrubidium <rubidium@openttd.org>2013-02-17 14:54:50 +0000
commitcdb0a7695820ac088df6736cb59ac9989f945c8e (patch)
tree4eb4c9a8818a518622d32c3599c1c3e285dafdbe /src/cargoaction.h
parent446d50f6580d6d71ac30d6d64b72cb3e5c4c3aaa (diff)
downloadopenttd-cdb0a7695820ac088df6736cb59ac9989f945c8e.tar.xz
(svn r25012) -Codechange: persistently keep 'reserved' cargo (for full-load improved loading) instead of calculating if for every cycle
Diffstat (limited to 'src/cargoaction.h')
-rw-r--r--src/cargoaction.h24
1 files changed, 17 insertions, 7 deletions
diff --git a/src/cargoaction.h b/src/cargoaction.h
index f7ee1a001..d59f05279 100644
--- a/src/cargoaction.h
+++ b/src/cargoaction.h
@@ -34,13 +34,7 @@ public:
*/
uint MaxMove() { return this->max_move; }
- /**
- * Removes some cargo.
- * @param cp Packet to be removed.
- * @return True if the packet was completely delivered, false if only part of
- * it was.
- */
- inline bool operator()(CargoPacket *cp) { return this->Postprocess(cp, this->Preprocess(cp)); }
+ bool operator()(CargoPacket *cp);
};
/** Action of final delivery of cargo. */
@@ -95,6 +89,22 @@ public:
bool operator()(CargoPacket *cp);
};
+/** Action of reserving cargo from a station to be loaded onto a vehicle. */
+class CargoReservation: public CargoLoad {
+public:
+ CargoReservation(StationCargoList *source, VehicleCargoList *destination, uint max_move, TileIndex load_place) :
+ CargoLoad(source, destination, max_move, load_place) {}
+ bool operator()(CargoPacket *cp);
+};
+
+/** Action of returning previously reserved cargo from the vehicle to the station. */
+class CargoReturn: public CargoMovement<VehicleCargoList, StationCargoList> {
+public:
+ CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move) :
+ CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move) {}
+ bool operator()(CargoPacket *cp);
+};
+
/** Action of shifting cargo from one vehicle to another. */
class CargoShift : public CargoMovement<VehicleCargoList, VehicleCargoList> {
public: