summaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:59:36 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:59:36 +0000
commit77b7366c2947a3f2545d5542021be1cc203a74e8 (patch)
tree5fac077be3e90460822aa50987f903fb8f86a7aa /src/script
parente7cd301d3c9990b4ef9f0748789bb5e0318c0d24 (diff)
downloadopenttd-77b7366c2947a3f2545d5542021be1cc203a74e8.tar.xz
(svn r23622) -Add: a set of events to trigger in a GameScript
Diffstat (limited to 'src/script')
-rw-r--r--src/script/api/game/game_event_types.hpp.sq219
-rw-r--r--src/script/api/script_event_types.hpp26
2 files changed, 232 insertions, 13 deletions
diff --git a/src/script/api/game/game_event_types.hpp.sq b/src/script/api/game/game_event_types.hpp.sq
new file mode 100644
index 000000000..a6e806ffd
--- /dev/null
+++ b/src/script/api/game/game_event_types.hpp.sq
@@ -0,0 +1,219 @@
+/* $Id$ */
+
+/*
+ * This file is part of OpenTTD.
+ * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
+ * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_event_types.hpp"
+#include "../template/template_event_types.hpp.sq"
+
+
+template <> const char *GetClassName<ScriptEventVehicleCrashed, ST_GS>() { return "GSEventVehicleCrashed"; }
+
+void SQGSEventVehicleCrashed_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventVehicleCrashed, ST_GS> SQGSEventVehicleCrashed("GSEventVehicleCrashed");
+ SQGSEventVehicleCrashed.PreRegister(engine, "GSEvent");
+
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_TRAIN, "CRASH_TRAIN");
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING, "CRASH_RV_LEVEL_CROSSING");
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_RV_UFO, "CRASH_RV_UFO");
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_PLANE_LANDING, "CRASH_PLANE_LANDING");
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT, "CRASH_AIRCRAFT_NO_AIRPORT");
+ SQGSEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_FLOODED, "CRASH_FLOODED");
+
+ SQGSEventVehicleCrashed.DefSQStaticMethod(engine, &ScriptEventVehicleCrashed::Convert, "Convert", 2, ".x");
+
+ SQGSEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetVehicleID, "GetVehicleID", 1, "x");
+ SQGSEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetCrashSite, "GetCrashSite", 1, "x");
+ SQGSEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetCrashReason, "GetCrashReason", 1, "x");
+
+ SQGSEventVehicleCrashed.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventSubsidyOffer, ST_GS>() { return "GSEventSubsidyOffer"; }
+
+void SQGSEventSubsidyOffer_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventSubsidyOffer, ST_GS> SQGSEventSubsidyOffer("GSEventSubsidyOffer");
+ SQGSEventSubsidyOffer.PreRegister(engine, "GSEvent");
+
+ SQGSEventSubsidyOffer.DefSQStaticMethod(engine, &ScriptEventSubsidyOffer::Convert, "Convert", 2, ".x");
+
+ SQGSEventSubsidyOffer.DefSQMethod(engine, &ScriptEventSubsidyOffer::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQGSEventSubsidyOffer.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventSubsidyOfferExpired, ST_GS>() { return "GSEventSubsidyOfferExpired"; }
+
+void SQGSEventSubsidyOfferExpired_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventSubsidyOfferExpired, ST_GS> SQGSEventSubsidyOfferExpired("GSEventSubsidyOfferExpired");
+ SQGSEventSubsidyOfferExpired.PreRegister(engine, "GSEvent");
+
+ SQGSEventSubsidyOfferExpired.DefSQStaticMethod(engine, &ScriptEventSubsidyOfferExpired::Convert, "Convert", 2, ".x");
+
+ SQGSEventSubsidyOfferExpired.DefSQMethod(engine, &ScriptEventSubsidyOfferExpired::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQGSEventSubsidyOfferExpired.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventSubsidyAwarded, ST_GS>() { return "GSEventSubsidyAwarded"; }
+
+void SQGSEventSubsidyAwarded_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventSubsidyAwarded, ST_GS> SQGSEventSubsidyAwarded("GSEventSubsidyAwarded");
+ SQGSEventSubsidyAwarded.PreRegister(engine, "GSEvent");
+
+ SQGSEventSubsidyAwarded.DefSQStaticMethod(engine, &ScriptEventSubsidyAwarded::Convert, "Convert", 2, ".x");
+
+ SQGSEventSubsidyAwarded.DefSQMethod(engine, &ScriptEventSubsidyAwarded::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQGSEventSubsidyAwarded.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventSubsidyExpired, ST_GS>() { return "GSEventSubsidyExpired"; }
+
+void SQGSEventSubsidyExpired_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventSubsidyExpired, ST_GS> SQGSEventSubsidyExpired("GSEventSubsidyExpired");
+ SQGSEventSubsidyExpired.PreRegister(engine, "GSEvent");
+
+ SQGSEventSubsidyExpired.DefSQStaticMethod(engine, &ScriptEventSubsidyExpired::Convert, "Convert", 2, ".x");
+
+ SQGSEventSubsidyExpired.DefSQMethod(engine, &ScriptEventSubsidyExpired::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQGSEventSubsidyExpired.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventCompanyNew, ST_GS>() { return "GSEventCompanyNew"; }
+
+void SQGSEventCompanyNew_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventCompanyNew, ST_GS> SQGSEventCompanyNew("GSEventCompanyNew");
+ SQGSEventCompanyNew.PreRegister(engine, "GSEvent");
+
+ SQGSEventCompanyNew.DefSQStaticMethod(engine, &ScriptEventCompanyNew::Convert, "Convert", 2, ".x");
+
+ SQGSEventCompanyNew.DefSQMethod(engine, &ScriptEventCompanyNew::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQGSEventCompanyNew.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventCompanyInTrouble, ST_GS>() { return "GSEventCompanyInTrouble"; }
+
+void SQGSEventCompanyInTrouble_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventCompanyInTrouble, ST_GS> SQGSEventCompanyInTrouble("GSEventCompanyInTrouble");
+ SQGSEventCompanyInTrouble.PreRegister(engine, "GSEvent");
+
+ SQGSEventCompanyInTrouble.DefSQStaticMethod(engine, &ScriptEventCompanyInTrouble::Convert, "Convert", 2, ".x");
+
+ SQGSEventCompanyInTrouble.DefSQMethod(engine, &ScriptEventCompanyInTrouble::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQGSEventCompanyInTrouble.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventCompanyMerger, ST_GS>() { return "GSEventCompanyMerger"; }
+
+void SQGSEventCompanyMerger_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventCompanyMerger, ST_GS> SQGSEventCompanyMerger("GSEventCompanyMerger");
+ SQGSEventCompanyMerger.PreRegister(engine, "GSEvent");
+
+ SQGSEventCompanyMerger.DefSQStaticMethod(engine, &ScriptEventCompanyMerger::Convert, "Convert", 2, ".x");
+
+ SQGSEventCompanyMerger.DefSQMethod(engine, &ScriptEventCompanyMerger::GetOldCompanyID, "GetOldCompanyID", 1, "x");
+ SQGSEventCompanyMerger.DefSQMethod(engine, &ScriptEventCompanyMerger::GetNewCompanyID, "GetNewCompanyID", 1, "x");
+
+ SQGSEventCompanyMerger.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventCompanyBankrupt, ST_GS>() { return "GSEventCompanyBankrupt"; }
+
+void SQGSEventCompanyBankrupt_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventCompanyBankrupt, ST_GS> SQGSEventCompanyBankrupt("GSEventCompanyBankrupt");
+ SQGSEventCompanyBankrupt.PreRegister(engine, "GSEvent");
+
+ SQGSEventCompanyBankrupt.DefSQStaticMethod(engine, &ScriptEventCompanyBankrupt::Convert, "Convert", 2, ".x");
+
+ SQGSEventCompanyBankrupt.DefSQMethod(engine, &ScriptEventCompanyBankrupt::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQGSEventCompanyBankrupt.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventIndustryOpen, ST_GS>() { return "GSEventIndustryOpen"; }
+
+void SQGSEventIndustryOpen_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventIndustryOpen, ST_GS> SQGSEventIndustryOpen("GSEventIndustryOpen");
+ SQGSEventIndustryOpen.PreRegister(engine, "GSEvent");
+
+ SQGSEventIndustryOpen.DefSQStaticMethod(engine, &ScriptEventIndustryOpen::Convert, "Convert", 2, ".x");
+
+ SQGSEventIndustryOpen.DefSQMethod(engine, &ScriptEventIndustryOpen::GetIndustryID, "GetIndustryID", 1, "x");
+
+ SQGSEventIndustryOpen.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventIndustryClose, ST_GS>() { return "GSEventIndustryClose"; }
+
+void SQGSEventIndustryClose_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventIndustryClose, ST_GS> SQGSEventIndustryClose("GSEventIndustryClose");
+ SQGSEventIndustryClose.PreRegister(engine, "GSEvent");
+
+ SQGSEventIndustryClose.DefSQStaticMethod(engine, &ScriptEventIndustryClose::Convert, "Convert", 2, ".x");
+
+ SQGSEventIndustryClose.DefSQMethod(engine, &ScriptEventIndustryClose::GetIndustryID, "GetIndustryID", 1, "x");
+
+ SQGSEventIndustryClose.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventStationFirstVehicle, ST_GS>() { return "GSEventStationFirstVehicle"; }
+
+void SQGSEventStationFirstVehicle_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventStationFirstVehicle, ST_GS> SQGSEventStationFirstVehicle("GSEventStationFirstVehicle");
+ SQGSEventStationFirstVehicle.PreRegister(engine, "GSEvent");
+
+ SQGSEventStationFirstVehicle.DefSQStaticMethod(engine, &ScriptEventStationFirstVehicle::Convert, "Convert", 2, ".x");
+
+ SQGSEventStationFirstVehicle.DefSQMethod(engine, &ScriptEventStationFirstVehicle::GetStationID, "GetStationID", 1, "x");
+ SQGSEventStationFirstVehicle.DefSQMethod(engine, &ScriptEventStationFirstVehicle::GetVehicleID, "GetVehicleID", 1, "x");
+
+ SQGSEventStationFirstVehicle.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName<ScriptEventTownFounded, ST_GS>() { return "GSEventTownFounded"; }
+
+void SQGSEventTownFounded_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptEventTownFounded, ST_GS> SQGSEventTownFounded("GSEventTownFounded");
+ SQGSEventTownFounded.PreRegister(engine, "GSEvent");
+
+ SQGSEventTownFounded.DefSQStaticMethod(engine, &ScriptEventTownFounded::Convert, "Convert", 2, ".x");
+
+ SQGSEventTownFounded.DefSQMethod(engine, &ScriptEventTownFounded::GetTownID, "GetTownID", 1, "x");
+
+ SQGSEventTownFounded.PostRegister(engine);
+}
diff --git a/src/script/api/script_event_types.hpp b/src/script/api/script_event_types.hpp
index 472fc72a2..cffa4a797 100644
--- a/src/script/api/script_event_types.hpp
+++ b/src/script/api/script_event_types.hpp
@@ -18,7 +18,7 @@
/**
* Event Vehicle Crash, indicating a vehicle of yours is crashed.
* It contains the crash site, the crashed vehicle and the reason for the crash.
- * @api ai
+ * @api ai game
*/
class ScriptEventVehicleCrashed : public ScriptEvent {
public:
@@ -79,7 +79,7 @@ private:
/**
* Event Subsidy Offered, indicating someone offered a subsidy.
- * @api ai
+ * @api ai game
*/
class ScriptEventSubsidyOffer : public ScriptEvent {
public:
@@ -110,7 +110,7 @@ private:
/**
* Event Subsidy Offer Expired, indicating a subsidy will no longer be awarded.
- * @api ai
+ * @api ai game
*/
class ScriptEventSubsidyOfferExpired : public ScriptEvent {
public:
@@ -141,7 +141,7 @@ private:
/**
* Event Subidy Awarded, indicating a subsidy is awarded to some company.
- * @api ai
+ * @api ai game
*/
class ScriptEventSubsidyAwarded : public ScriptEvent {
public:
@@ -172,7 +172,7 @@ private:
/**
* Event Subsidy Expired, indicating a route that was once subsidized no longer is.
- * @api ai
+ * @api ai game
*/
class ScriptEventSubsidyExpired : public ScriptEvent {
public:
@@ -294,7 +294,7 @@ private:
/**
* Event Company New, indicating a new company has been created.
- * @api ai
+ * @api ai game
*/
class ScriptEventCompanyNew : public ScriptEvent {
public:
@@ -326,7 +326,7 @@ private:
/**
* Event Company In Trouble, indicating a company is in trouble and might go
* bankrupt soon.
- * @api ai
+ * @api ai game
*/
class ScriptEventCompanyInTrouble : public ScriptEvent {
public:
@@ -405,7 +405,7 @@ private:
/**
* Event Company Merger, indicating a company has been bought by another
* company.
- * @api ai
+ * @api ai game
*/
class ScriptEventCompanyMerger : public ScriptEvent {
public:
@@ -448,7 +448,7 @@ private:
/**
* Event Company Bankrupt, indicating a company has gone bankrupt.
- * @api ai
+ * @api ai game
*/
class ScriptEventCompanyBankrupt : public ScriptEvent {
public:
@@ -572,7 +572,7 @@ private:
/**
* Event Industry Open, indicating a new industry has been created.
- * @api ai
+ * @api ai game
*/
class ScriptEventIndustryOpen : public ScriptEvent {
public:
@@ -603,7 +603,7 @@ private:
/**
* Event Industry Close, indicating an industry is going to be closed.
- * @api ai
+ * @api ai game
*/
class ScriptEventIndustryClose : public ScriptEvent {
public:
@@ -665,7 +665,7 @@ private:
/**
* Event Station First Vehicle, indicating a station has been visited by a vehicle for the first time.
- * @api ai
+ * @api ai game
*/
class ScriptEventStationFirstVehicle : public ScriptEvent {
public:
@@ -767,7 +767,7 @@ private:
/**
* Event Town Founded, indicating a new town has been created.
- * @api ai
+ * @api ai game
*/
class ScriptEventTownFounded : public ScriptEvent {
public: