summaryrefslogtreecommitdiff
path: root/src/script/api/script_cargo.hpp
diff options
context:
space:
mode:
authorzuu <zuu@openttd.org>2014-03-10 22:18:53 +0000
committerzuu <zuu@openttd.org>2014-03-10 22:18:53 +0000
commitae23f519f708d6f963a1223021455440e13fe9aa (patch)
tree6a17b511109b373a9b15061beaedbf83b6041d3e /src/script/api/script_cargo.hpp
parent51501be48f3d499fa8db0829ab6aaf19d5dfdc74 (diff)
downloadopenttd-ae23f519f708d6f963a1223021455440e13fe9aa.tar.xz
(svn r26396) -Add: [script] AI/GS APIs to get cargo waiting from/via other station
Diffstat (limited to 'src/script/api/script_cargo.hpp')
-rw-r--r--src/script/api/script_cargo.hpp18
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 */