(svn r25361) -Feature: distribute cargo according to plan given by linkgraph

This commit is contained in:
fonsinchen
2013-06-09 13:03:48 +00:00
parent 45d7df8fc2
commit f022550df9
16 changed files with 586 additions and 206 deletions

View File

@@ -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 */