summaryrefslogtreecommitdiff
path: root/src/cargotype.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2007-02-20 22:09:21 +0000
committerpeter1138 <peter1138@openttd.org>2007-02-20 22:09:21 +0000
commitef2daa5060e251834e82df1ba3e081579ff84f2f (patch)
tree9caff20858ac3f06265e4f69d54b9cdb03a47004 /src/cargotype.h
parent6621beb126c4bf1481b9d7826f3efd10c2bb8308 (diff)
downloadopenttd-ef2daa5060e251834e82df1ba3e081579ff84f2f.tar.xz
(svn r8826) -Codechange: Replace _cargoc's separate arrays with a regular struct array (with accessor) and implement new initialization method using cargo labels.
Diffstat (limited to 'src/cargotype.h')
-rw-r--r--src/cargotype.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/cargotype.h b/src/cargotype.h
new file mode 100644
index 000000000..2e202f9de
--- /dev/null
+++ b/src/cargotype.h
@@ -0,0 +1,42 @@
+/* $Id$ */
+
+#ifndef CARGOTYPE_H
+#define CARGOTYPE_H
+
+
+typedef uint32 CargoLabel;
+
+
+typedef struct CargoSpec {
+ uint8 bitnum;
+ CargoLabel label;
+ uint32 grfid;
+ uint8 legend_colour;
+ uint8 rating_colour;
+ uint8 weight;
+ uint16 initial_payment;
+ uint8 transit_days[2];
+
+ bool is_freight;
+ uint8 substitutetowngrowth;
+ uint16 multipliertowngrowth;
+ uint8 callbackflags;
+
+ StringID name;
+ StringID name_plural;
+ StringID units_volume;
+ StringID quantifier;
+ StringID abbrev;
+
+ SpriteID sprite;
+
+ uint16 classes;
+} CargoSpec;
+
+
+/* Set up the default cargo types for the given landscape type */
+void SetupCargoForClimate(LandscapeID l);
+/* Retrieve cargo details for the given cargo ID */
+const CargoSpec *GetCargo(CargoID c);
+
+#endif /* CARGOTYPE_H */