summaryrefslogtreecommitdiff
path: root/src/newgrf_generic.h
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2008-02-12 13:23:57 +0000
committerpeter1138 <peter1138@openttd.org>2008-02-12 13:23:57 +0000
commit4d0c443953d5f12ab13620b53f0179556f01f9e9 (patch)
tree4c08b2e82cdcf9be813d4276fb3891ed14130483 /src/newgrf_generic.h
parent9f6fd72c0981e2648eb23301d2a4aed23d38d63f (diff)
downloadopenttd-4d0c443953d5f12ab13620b53f0179556f01f9e9.tar.xz
(svn r12122) -Codechange: Add framework for generic feature callbacks, along with some parts for AI use.
Diffstat (limited to 'src/newgrf_generic.h')
-rw-r--r--src/newgrf_generic.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/newgrf_generic.h b/src/newgrf_generic.h
new file mode 100644
index 000000000..0c24f88fc
--- /dev/null
+++ b/src/newgrf_generic.h
@@ -0,0 +1,35 @@
+/* $Id$ */
+
+#ifndef NEWGRF_GENERIC_H
+#define NEWGRF_GENERIC_H
+
+enum AIConstructionEvent {
+ AICE_TRAIN_CHECK_RAIL_ENGINE = 0x00, ///< Check if we should build an engine
+ AICE_TRAIN_CHECK_ELRAIL_ENGINE = 0x01,
+ AICE_TRAIN_CHECK_MONORAIL_ENGINE = 0x02,
+ AICE_TRAIN_CHECK_MAGLEV_ENGINE = 0x03,
+ AICE_TRAIN_GET_RAIL_WAGON = 0x08,
+ AICE_TRAIN_GET_ELRAIL_WAGON = 0x09,
+ AICE_TRAIN_GET_MONORAIL_WAGON = 0x0A,
+ AICE_TRAIN_GET_MAGLEV_WAGON = 0x0B,
+ AICE_TRAIN_GET_RAILTYPE = 0x0F,
+
+ AICE_ROAD_CHECK_ENGINE = 0x00, ///< Check if we should build an engine
+ AICE_ROAD_GET_FIRST_ENGINE = 0x01, ///< Unused, we check all
+ AICE_ROAD_GET_NUMBER_ENGINES = 0x02, ///< Unused, we check all
+
+ AICE_SHIP_CHECK_ENGINE = 0x00, ///< Check if we should build an engine
+ AICE_SHIP_GET_FIRST_ENGINE = 0x01, ///< Unused, we check all
+ AICE_SHIP_GET_NUMBER_ENGINES = 0x02, ///< Unused, we check all
+
+ AICE_AIRCRAFT_CHECK_ENGINE = 0x00, ///< Check if we should build an engine
+
+ AICE_STATION_GET_STATION_ID = 0x00, ///< Get a station ID to build
+};
+
+void ResetGenericCallbacks();
+void AddGenericCallback(uint8 feature, const struct GRFFile *file, const struct SpriteGroup *group);
+
+uint16 GetAiPurchaseCallbackResult(uint8 feature, CargoID cargo_type, uint8 default_selection, IndustryType src_industry, IndustryType dst_industry, uint8 distance, AIConstructionEvent event, uint8 count, uint8 station_size, const struct GRFFile **file);
+
+#endif /* NEWGRF_GENERIC_H */