summaryrefslogtreecommitdiff
path: root/src/cargo_type.h
diff options
context:
space:
mode:
authorsmatz <smatz@openttd.org>2009-08-07 22:23:34 +0000
committersmatz <smatz@openttd.org>2009-08-07 22:23:34 +0000
commit74d3382b946d71445fbce5699d1541946e928450 (patch)
tree03fe2b58ca63a3e1629c08eefbdf061154cc977c /src/cargo_type.h
parent39e145e586385861b4e3ded70f7df0a29b56fa00 (diff)
downloadopenttd-74d3382b946d71445fbce5699d1541946e928450.tar.xz
(svn r17107) -Codechange: store type of subsidy source and destination in the Subsidy struct instead of determining it every time it's needed
Diffstat (limited to 'src/cargo_type.h')
-rw-r--r--src/cargo_type.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/cargo_type.h b/src/cargo_type.h
index 4fd424d35..30145f266 100644
--- a/src/cargo_type.h
+++ b/src/cargo_type.h
@@ -5,6 +5,8 @@
#ifndef CARGO_TYPE_H
#define CARGO_TYPE_H
+#include "core/enum_type.hpp"
+
typedef byte CargoID;
/** Available types of cargo */
@@ -82,4 +84,16 @@ public:
}
};
+
+/** Types of subsidy source and destination */
+enum SourceType {
+ ST_INDUSTRY, ///< Source/destination is an industry
+ ST_TOWN, ///< Source/destination is a town
+ ST_STATION, ///< Source/destination is a station
+};
+typedef SimpleTinyEnumT<SourceType, byte> SourceTypeByte;
+
+typedef uint16 SourceID; ///< Contains either industry ID, town ID or station ID (or INVALID_SOURCE)
+static const SourceID INVALID_SOURCE = 0xFFFF; ///< Invalid/unknown index of source
+
#endif /* CARGO_TYPE_H */