summaryrefslogtreecommitdiff
path: root/openttd.h
diff options
context:
space:
mode:
authortruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
committertruelight <truelight@openttd.org>2006-08-26 16:34:03 +0000
commitdb8dfcd6e90f13ed0aafec06fc5975967afb1bb5 (patch)
tree7f558c2b1487df44a464aa980693e44cb438c592 /openttd.h
parentf73a2829f364b07d6f944b8b49e156b9774db39b (diff)
downloadopenttd-db8dfcd6e90f13ed0aafec06fc5975967afb1bb5.tar.xz
(svn r6142) -Codechange: added WaypointID (sorry DV, couldn't splits it anymore)
-Codechange: introduced DestinationID, which is in fact an union of several types Used in Order struct, so no longer StationID is abused for all targets. Hangars are a big exception, as they use a station-id with GOTO_DEPOT (go figure)
Diffstat (limited to 'openttd.h')
-rw-r--r--openttd.h23
1 files changed, 19 insertions, 4 deletions
diff --git a/openttd.h b/openttd.h
index 938b2dcad..087c3e4c7 100644
--- a/openttd.h
+++ b/openttd.h
@@ -40,18 +40,33 @@ typedef uint16 StationID;
typedef uint16 TownID;
typedef uint16 IndustryID;
typedef uint16 DepotID;
+typedef uint16 WaypointID;
typedef byte PlayerID;
typedef byte OrderID;
typedef byte CargoID;
typedef byte LandscapeID;
typedef uint16 StringID;
-typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables
-typedef uint32 PalSpriteID; ///< The number of a sprite plus all the mapping bits and colortables
+typedef uint32 SpriteID; ///< The number of a sprite, without mapping bits and colortables
+typedef uint32 PalSpriteID; ///< The number of a sprite plus all the mapping bits and colortables
typedef uint32 CursorID;
-typedef uint16 EngineID; ///< All enginenumbers should be of this type
+typedef uint16 EngineID;
typedef uint16 EngineRenewID;
typedef uint16 SignID;
-typedef uint16 UnitID; ///< All unitnumber stuff is of this type (or anyway, should be)
+typedef uint16 UnitID;
+
+typedef union DestinationID {
+ StationID station;
+ DepotID depot;
+ WaypointID waypoint;
+ uint16 disaster; ///< Please don't ask about it, but disasters uses orders to store stuff...
+} DestinationID;
+
+/* All items of DestionationID has to be of the same size, because some part
+ * of the code depends on the fact that DestionationID is the same for all
+ * items inside DestionationID. Check PackOrder() */
+assert_compile(sizeof(StationID) == sizeof(DepotID));
+assert_compile(sizeof(StationID) == sizeof(WaypointID));
+assert_compile(sizeof(StationID) == sizeof(uint16));
typedef uint32 WindowNumber;
typedef byte WindowClass;