summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfonsinchen <fonsinchen@openttd.org>2013-06-09 12:53:34 +0000
committerfonsinchen <fonsinchen@openttd.org>2013-06-09 12:53:34 +0000
commitfdf04f60e0b9ea713670ff75e8896264ea15e75b (patch)
treea24bca3939bfe8d90a693722e3644927fa07c50a
parent793cc5d9d60d7b9080793de751e767533d1823ac (diff)
downloadopenttd-fdf04f60e0b9ea713670ff75e8896264ea15e75b.tar.xz
(svn r25350) -Add: basic definitions for link graph
-rw-r--r--src/linkgraph/linkgraph_type.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/linkgraph/linkgraph_type.h b/src/linkgraph/linkgraph_type.h
index 13411a707..277e56c73 100644
--- a/src/linkgraph/linkgraph_type.h
+++ b/src/linkgraph/linkgraph_type.h
@@ -21,4 +21,22 @@ static const LinkGraphID INVALID_LIN_KGRAPH_JOB = UINT16_MAX;
typedef uint16 NodeID;
static const NodeID INVALID_NODE = UINT16_MAX;
+enum DistributionType {
+ DT_BEGIN = 0,
+ DT_MIN = 0,
+ DT_MANUAL = 0, ///< Manual distribution. No link graph calculations are run.
+ DT_ASYMMETRIC = 1, ///< Asymmetric distribution. Usually cargo will only travel in one direction.
+ DT_MAX_NONSYMMETRIC = 1, ///< Maximum non-symmetric distribution.
+ DT_SYMMETRIC = 2, ///< Symmetric distribution. The same amount of cargo travels in each direction between each pair of nodes.
+ DT_MAX = 2,
+ DT_NUM = 3,
+ DT_END = 3
+};
+
+/* It needs to be 8bits, because we save and load it as such
+ * Define basic enum properties
+ */
+template <> struct EnumPropsT<DistributionType> : MakeEnumPropsT<DistributionType, byte, DT_BEGIN, DT_END, DT_NUM> {};
+typedef TinyEnumT<DistributionType> DistributionTypeByte; // typedefing-enumification of DistributionType
+
#endif /* LINKGRAPH_TYPE_H */