summaryrefslogtreecommitdiff
path: root/src/cargoaction.h
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-06-09 13:03:48 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-06-09 13:03:48 +0000
commit04e3eb6fabc0e4aff04c189368356b8af15e9655 (patch)
treeaa9d6a025fb3e343fc8cdc9358a913182445210b /src/cargoaction.h
parenta2ff96d6828bd32f7beb461bfb902880bf46ef75 (diff)
downloadopenttd-04e3eb6fabc0e4aff04c189368356b8af15e9655.tar.xz
(svn r25361) -Feature: distribute cargo according to plan given by linkgraph
Diffstat (limited to 'src/cargoaction.h')
-rw-r--r--src/cargoaction.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/cargoaction.h b/src/cargoaction.h
index d59f05279..b6879fb76 100644
--- a/src/cargoaction.h
+++ b/src/cargoaction.h
@@ -71,11 +71,9 @@ public:
/** Action of transferring cargo from a vehicle to a station. */
class CargoTransfer : public CargoMovement<VehicleCargoList, StationCargoList> {
-protected:
- CargoPayment *payment; ///< Payment object for registering transfer credits.
public:
- CargoTransfer(VehicleCargoList *source, StationCargoList *destination, uint max_move, CargoPayment *payment) :
- CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), payment(payment) {}
+ CargoTransfer(VehicleCargoList *source, StationCargoList *destination, uint max_move) :
+ CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move) {}
bool operator()(CargoPacket *cp);
};
@@ -99,9 +97,10 @@ public:
/** Action of returning previously reserved cargo from the vehicle to the station. */
class CargoReturn: public CargoMovement<VehicleCargoList, StationCargoList> {
+ StationID next;
public:
- CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move) :
- CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move) {}
+ CargoReturn(VehicleCargoList *source, StationCargoList *destination, uint max_move, StationID next) :
+ CargoMovement<VehicleCargoList, StationCargoList>(source, destination, max_move), next(next) {}
bool operator()(CargoPacket *cp);
};
@@ -113,4 +112,16 @@ public:
bool operator()(CargoPacket *cp);
};
+/** Action of rerouting cargo between different station cargo lists and/or next hops. */
+class CargoReroute : public CargoMovement<StationCargoList, StationCargoList> {
+protected:
+ StationID avoid;
+ StationID avoid2;
+ const GoodsEntry *ge;
+public:
+ CargoReroute(StationCargoList *source, StationCargoList *dest, uint max_move, StationID avoid, StationID avoid2, const GoodsEntry *ge) :
+ CargoMovement<StationCargoList, StationCargoList>(source, dest, max_move), avoid(avoid), avoid2(avoid2), ge(ge) {}
+ bool operator()(CargoPacket *cp);
+};
+
#endif /* CARGOACTION_H */