summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_event_types.hpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2010-12-29 23:44:39 +0000
committeryexo <yexo@openttd.org>2010-12-29 23:44:39 +0000
commit703ff560c19e2b21597e9ed25b3e394a2085702a (patch)
treec1d2b4b0197c9adfee798f7823534f91f4dddf2c /src/ai/api/ai_event_types.hpp
parent5b25e620dd747d35b024d6d244be9fc7002e38b0 (diff)
downloadopenttd-703ff560c19e2b21597e9ed25b3e394a2085702a.tar.xz
(svn r21664) -Add: [NoAI] AIEventTownFounded
Diffstat (limited to 'src/ai/api/ai_event_types.hpp')
-rw-r--r--src/ai/api/ai_event_types.hpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/ai/api/ai_event_types.hpp b/src/ai/api/ai_event_types.hpp
index da6b54983..acb36c77c 100644
--- a/src/ai/api/ai_event_types.hpp
+++ b/src/ai/api/ai_event_types.hpp
@@ -800,4 +800,37 @@ private:
StationID station;
};
+/**
+ * Event Town Founded, indicating a new town has been created.
+ */
+class AIEventTownFounded : public AIEvent {
+public:
+ /** Get the name of this class to identify it towards squirrel. */
+ static const char *GetClassName() { return "AIEventTownFounded"; }
+
+ /**
+ * @param town The town that was created.
+ */
+ AIEventTownFounded(TownID town) :
+ AIEvent(AI_ET_TOWN_FOUNDED),
+ town(town)
+ {}
+
+ /**
+ * Convert an AIEvent to the real instance.
+ * @param instance The instance to convert.
+ * @return The converted instance.
+ */
+ static AIEventTownFounded *Convert(AIEvent *instance) { return (AIEventTownFounded *)instance; }
+
+ /**
+ * Get the TownID of the town.
+ * @return The TownID of the town that was created.
+ */
+ TownID GetTownID() { return this->town; }
+
+private:
+ TownID town;
+};
+
#endif /* AI_EVENT_TYPES_HPP */