diff options
Diffstat (limited to 'src/script/api/script_cargo.hpp')
-rw-r--r-- | src/script/api/script_cargo.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/script/api/script_cargo.hpp b/src/script/api/script_cargo.hpp index f4e430362..9d409e191 100644 --- a/src/script/api/script_cargo.hpp +++ b/src/script/api/script_cargo.hpp @@ -14,6 +14,7 @@ #include "script_object.hpp" #include "../../cargotype.h" +#include "../../linkgraph/linkgraph_type.h" /** * Class that handles all cargo related functions. @@ -61,6 +62,16 @@ public: }; /** + * Type of cargo distribution. + */ + enum DistributionType { + DT_MANUAL = ::DT_MANUAL, ///< Manual distribution. + DT_ASYMMETRIC = ::DT_ASYMMETRIC, ///< Asymmetric distribution. Usually cargo will only travel in one direction. + DT_SYMMETRIC = ::DT_SYMMETRIC, ///< Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes. + INVALID_DISTRIBUTION_TYPE = 0xFFFF, ///< Invalid distribution type. + }; + + /** * Checks whether the given cargo type is valid. * @param cargo_type The cargo to check. * @return True if and only if the cargo type is valid. @@ -121,6 +132,13 @@ public: * @return The amount of money that would be earned by this trip. */ static Money GetCargoIncome(CargoID cargo_type, uint32 distance, uint32 days_in_transit); + + /** + * Get the cargo distribution type for a cargo. + * @param cargo_type The cargo to check on. + * @return The cargo distribution type for the given cargo. + */ + static DistributionType GetDistributionType(CargoID cargo_type); }; #endif /* SCRIPT_CARGO_HPP */ |