summaryrefslogtreecommitdiff
path: root/src/network/network_type.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-06-19 16:37:56 +0000
committerrubidium <rubidium@openttd.org>2010-06-19 16:37:56 +0000
commit99a11badaf80f6f3a7ddaec74ca7fad712b28957 (patch)
tree699bca4bc13a2575e1e1e5277a2d7b2df2181b14 /src/network/network_type.h
parent5623710593ee9459c7c3faf2da3be92e7e7263f8 (diff)
downloadopenttd-99a11badaf80f6f3a7ddaec74ca7fad712b28957.tar.xz
(svn r19996) -Codechange: Add NetworkVehicleType enum.
Diffstat (limited to 'src/network/network_type.h')
-rw-r--r--src/network/network_type.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/network/network_type.h b/src/network/network_type.h
index 08bd7756d..a86ad9948 100644
--- a/src/network/network_type.h
+++ b/src/network/network_type.h
@@ -26,10 +26,18 @@ static const uint MAX_CLIENTS = 255;
*/
static const uint MAX_CLIENT_SLOTS = 256;
-/** How many vehicle types we put over the network */
-static const uint NETWORK_VEHICLE_TYPES = 5;
-/** How many station types we put over the network */
-static const uint NETWORK_STATION_TYPES = 5;
+/**
+ * Vehicletypes in the order they are send in info packets.
+ */
+enum NetworkVehicleType {
+ NETWORK_VEH_TRAIN = 0,
+ NETWORK_VEH_LORRY,
+ NETWORK_VEH_BUS,
+ NETWORK_VEH_PLANE,
+ NETWORK_VEH_SHIP,
+
+ NETWORK_VEH_END
+};
/** 'Unique' identifier to be given to clients */
enum ClientID {
@@ -43,8 +51,8 @@ typedef uint8 ClientIndex;
/** Simple calculated statistics of a company */
struct NetworkCompanyStats {
- uint16 num_vehicle[NETWORK_VEHICLE_TYPES]; ///< How many vehicles are there of this type?
- uint16 num_station[NETWORK_STATION_TYPES]; ///< How many stations are there of this type?
+ uint16 num_vehicle[NETWORK_VEH_END]; ///< How many vehicles are there of this type?
+ uint16 num_station[NETWORK_VEH_END]; ///< How many stations are there of this type?
bool ai; ///< Is this company an AI
};