diff --git a/src/ai/ai_instance.cpp b/src/ai/ai_instance.cpp
index d7459005da..e3375a0bab 100644
--- a/src/ai/ai_instance.cpp
+++ b/src/ai/ai_instance.cpp
@@ -28,55 +28,55 @@
/* Convert all AI related classes to Squirrel data.
* Note: this line is a marker in squirrel_export.sh. Do not change! */
-#include "api/ai_accounting.hpp.sq"
-#include "api/ai_airport.hpp.sq"
-#include "api/ai_base.hpp.sq"
-#include "api/ai_basestation.hpp.sq"
-#include "api/ai_bridge.hpp.sq"
-#include "api/ai_bridgelist.hpp.sq"
-#include "api/ai_cargo.hpp.sq"
-#include "api/ai_cargolist.hpp.sq"
-#include "api/ai_company.hpp.sq"
-#include "api/ai_controller.hpp.sq"
-#include "api/ai_date.hpp.sq"
-#include "api/ai_depotlist.hpp.sq"
-#include "api/ai_engine.hpp.sq"
-#include "api/ai_enginelist.hpp.sq"
-#include "api/ai_error.hpp.sq"
-#include "api/ai_event.hpp.sq"
-#include "api/ai_event_types.hpp.sq"
-#include "api/ai_execmode.hpp.sq"
-#include "api/ai_gamesettings.hpp.sq"
-#include "api/ai_group.hpp.sq"
-#include "api/ai_grouplist.hpp.sq"
-#include "api/ai_industry.hpp.sq"
-#include "api/ai_industrylist.hpp.sq"
-#include "api/ai_industrytype.hpp.sq"
-#include "api/ai_industrytypelist.hpp.sq"
-#include "api/ai_list.hpp.sq"
-#include "api/ai_log.hpp.sq"
-#include "api/ai_map.hpp.sq"
-#include "api/ai_marine.hpp.sq"
-#include "api/ai_order.hpp.sq"
-#include "api/ai_rail.hpp.sq"
-#include "api/ai_railtypelist.hpp.sq"
-#include "api/ai_road.hpp.sq"
-#include "api/ai_sign.hpp.sq"
-#include "api/ai_signlist.hpp.sq"
-#include "api/ai_station.hpp.sq"
-#include "api/ai_stationlist.hpp.sq"
-#include "api/ai_subsidy.hpp.sq"
-#include "api/ai_subsidylist.hpp.sq"
-#include "api/ai_testmode.hpp.sq"
-#include "api/ai_tile.hpp.sq"
-#include "api/ai_tilelist.hpp.sq"
-#include "api/ai_town.hpp.sq"
-#include "api/ai_townlist.hpp.sq"
-#include "api/ai_tunnel.hpp.sq"
-#include "api/ai_vehicle.hpp.sq"
-#include "api/ai_vehiclelist.hpp.sq"
-#include "api/ai_waypoint.hpp.sq"
-#include "api/ai_waypointlist.hpp.sq"
+#include "../script/api/ai/ai_accounting.hpp.sq"
+#include "../script/api/ai/ai_airport.hpp.sq"
+#include "../script/api/ai/ai_base.hpp.sq"
+#include "../script/api/ai/ai_basestation.hpp.sq"
+#include "../script/api/ai/ai_bridge.hpp.sq"
+#include "../script/api/ai/ai_bridgelist.hpp.sq"
+#include "../script/api/ai/ai_cargo.hpp.sq"
+#include "../script/api/ai/ai_cargolist.hpp.sq"
+#include "../script/api/ai/ai_company.hpp.sq"
+#include "../script/api/ai/ai_controller.hpp.sq"
+#include "../script/api/ai/ai_date.hpp.sq"
+#include "../script/api/ai/ai_depotlist.hpp.sq"
+#include "../script/api/ai/ai_engine.hpp.sq"
+#include "../script/api/ai/ai_enginelist.hpp.sq"
+#include "../script/api/ai/ai_error.hpp.sq"
+#include "../script/api/ai/ai_event.hpp.sq"
+#include "../script/api/ai/ai_event_types.hpp.sq"
+#include "../script/api/ai/ai_execmode.hpp.sq"
+#include "../script/api/ai/ai_gamesettings.hpp.sq"
+#include "../script/api/ai/ai_group.hpp.sq"
+#include "../script/api/ai/ai_grouplist.hpp.sq"
+#include "../script/api/ai/ai_industry.hpp.sq"
+#include "../script/api/ai/ai_industrylist.hpp.sq"
+#include "../script/api/ai/ai_industrytype.hpp.sq"
+#include "../script/api/ai/ai_industrytypelist.hpp.sq"
+#include "../script/api/ai/ai_list.hpp.sq"
+#include "../script/api/ai/ai_log.hpp.sq"
+#include "../script/api/ai/ai_map.hpp.sq"
+#include "../script/api/ai/ai_marine.hpp.sq"
+#include "../script/api/ai/ai_order.hpp.sq"
+#include "../script/api/ai/ai_rail.hpp.sq"
+#include "../script/api/ai/ai_railtypelist.hpp.sq"
+#include "../script/api/ai/ai_road.hpp.sq"
+#include "../script/api/ai/ai_sign.hpp.sq"
+#include "../script/api/ai/ai_signlist.hpp.sq"
+#include "../script/api/ai/ai_station.hpp.sq"
+#include "../script/api/ai/ai_stationlist.hpp.sq"
+#include "../script/api/ai/ai_subsidy.hpp.sq"
+#include "../script/api/ai/ai_subsidylist.hpp.sq"
+#include "../script/api/ai/ai_testmode.hpp.sq"
+#include "../script/api/ai/ai_tile.hpp.sq"
+#include "../script/api/ai/ai_tilelist.hpp.sq"
+#include "../script/api/ai/ai_town.hpp.sq"
+#include "../script/api/ai/ai_townlist.hpp.sq"
+#include "../script/api/ai/ai_tunnel.hpp.sq"
+#include "../script/api/ai/ai_vehicle.hpp.sq"
+#include "../script/api/ai/ai_vehiclelist.hpp.sq"
+#include "../script/api/ai/ai_waypoint.hpp.sq"
+#include "../script/api/ai/ai_waypointlist.hpp.sq"
#include "../company_base.h"
#include "../company_func.h"
diff --git a/src/script/api/ai/ai_accounting.hpp.sq b/src/script/api/ai/ai_accounting.hpp.sq
new file mode 100644
index 0000000000..fd68e4e7e7
--- /dev/null
+++ b/src/script/api/ai/ai_accounting.hpp.sq
@@ -0,0 +1,28 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_accounting.hpp"
+#include "../template/template_accounting.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIAccounting"; }
+
+void SQAIAccounting_Register(Squirrel *engine)
+{
+ DefSQClass SQAIAccounting("AIAccounting");
+ SQAIAccounting.PreRegister(engine);
+ SQAIAccounting.AddConstructor(engine, "x");
+
+ SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::GetCosts, "GetCosts", 1, "x");
+ SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::ResetCosts, "ResetCosts", 1, "x");
+
+ SQAIAccounting.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_airport.hpp.sq b/src/script/api/ai/ai_airport.hpp.sq
similarity index 65%
rename from src/ai/api/ai_airport.hpp.sq
rename to src/script/api/ai/ai_airport.hpp.sq
index 413244d30d..961d3cdebb 100644
--- a/src/ai/api/ai_airport.hpp.sq
+++ b/src/script/api/ai/ai_airport.hpp.sq
@@ -9,22 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_airport.hpp"
+#include "../script_airport.hpp"
+#include "../template/template_airport.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptAirport::AirportType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptAirport::AirportType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptAirport::AirportType res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptAirport::PlaneType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptAirport::PlaneType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptAirport::PlaneType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptAirport to be used as Squirrel parameter */
- template <> inline ScriptAirport *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptAirport *)instance; }
- template <> inline ScriptAirport &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAirport *)instance; }
- template <> inline const ScriptAirport *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptAirport *)instance; }
- template <> inline const ScriptAirport &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAirport *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptAirport *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Airport", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIAirport"; }
diff --git a/src/script/api/ai/ai_base.hpp.sq b/src/script/api/ai/ai_base.hpp.sq
new file mode 100644
index 0000000000..68cc4a58e2
--- /dev/null
+++ b/src/script/api/ai/ai_base.hpp.sq
@@ -0,0 +1,32 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_base.hpp"
+#include "../template/template_base.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIBase"; }
+
+void SQAIBase_Register(Squirrel *engine)
+{
+ DefSQClass SQAIBase("AIBase");
+ SQAIBase.PreRegister(engine);
+ SQAIBase.AddConstructor(engine, "x");
+
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::Rand, "Rand", 1, ".");
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandItem, "RandItem", 2, ".i");
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandRange, "RandRange", 2, ".i");
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::RandRangeItem, "RandRangeItem", 3, ".ii");
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::Chance, "Chance", 3, ".ii");
+ SQAIBase.DefSQStaticMethod(engine, &ScriptBase::ChanceItem, "ChanceItem", 4, ".iii");
+
+ SQAIBase.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_basestation.hpp.sq b/src/script/api/ai/ai_basestation.hpp.sq
new file mode 100644
index 0000000000..42cc184609
--- /dev/null
+++ b/src/script/api/ai/ai_basestation.hpp.sq
@@ -0,0 +1,35 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_basestation.hpp"
+#include "../template/template_basestation.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIBaseStation"; }
+
+void SQAIBaseStation_Register(Squirrel *engine)
+{
+ DefSQClass SQAIBaseStation("AIBaseStation");
+ SQAIBaseStation.PreRegister(engine);
+ SQAIBaseStation.AddConstructor(engine, "x");
+
+ SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_NEW, "STATION_NEW");
+ SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_JOIN_ADJACENT, "STATION_JOIN_ADJACENT");
+ SQAIBaseStation.DefSQConst(engine, ScriptBaseStation::STATION_INVALID, "STATION_INVALID");
+
+ SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::IsValidBaseStation, "IsValidBaseStation", 2, ".i");
+ SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetName, "GetName", 2, ".i");
+ SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::SetName, "SetName", 3, ".i.");
+ SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetLocation, "GetLocation", 2, ".i");
+ SQAIBaseStation.DefSQStaticMethod(engine, &ScriptBaseStation::GetConstructionDate, "GetConstructionDate", 2, ".i");
+
+ SQAIBaseStation.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_bridge.hpp.sq b/src/script/api/ai/ai_bridge.hpp.sq
similarity index 64%
rename from src/ai/api/ai_bridge.hpp.sq
rename to src/script/api/ai/ai_bridge.hpp.sq
index 00aa16a378..d09f56421b 100644
--- a/src/ai/api/ai_bridge.hpp.sq
+++ b/src/script/api/ai/ai_bridge.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_bridge.hpp"
+#include "../script_bridge.hpp"
+#include "../template/template_bridge.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptBridge::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptBridge::ErrorMessages)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptBridge::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptBridge to be used as Squirrel parameter */
- template <> inline ScriptBridge *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptBridge *)instance; }
- template <> inline ScriptBridge &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridge *)instance; }
- template <> inline const ScriptBridge *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptBridge *)instance; }
- template <> inline const ScriptBridge &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptBridge *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptBridge *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Bridge", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIBridge"; }
diff --git a/src/script/api/ai/ai_bridgelist.hpp.sq b/src/script/api/ai/ai_bridgelist.hpp.sq
new file mode 100644
index 0000000000..b5618e3337
--- /dev/null
+++ b/src/script/api/ai/ai_bridgelist.hpp.sq
@@ -0,0 +1,37 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_bridgelist.hpp"
+#include "../template/template_bridgelist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIBridgeList"; }
+
+void SQAIBridgeList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIBridgeList("AIBridgeList");
+ SQAIBridgeList.PreRegister(engine, "AIList");
+ SQAIBridgeList.AddConstructor(engine, "x");
+
+ SQAIBridgeList.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIBridgeList_Length"; }
+
+void SQAIBridgeList_Length_Register(Squirrel *engine)
+{
+ DefSQClass SQAIBridgeList_Length("AIBridgeList_Length");
+ SQAIBridgeList_Length.PreRegister(engine, "AIList");
+ SQAIBridgeList_Length.AddConstructor(engine, "xi");
+
+ SQAIBridgeList_Length.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_cargo.hpp.sq b/src/script/api/ai/ai_cargo.hpp.sq
new file mode 100644
index 0000000000..c658721264
--- /dev/null
+++ b/src/script/api/ai/ai_cargo.hpp.sq
@@ -0,0 +1,52 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_cargo.hpp"
+#include "../template/template_cargo.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AICargo"; }
+
+void SQAICargo_Register(Squirrel *engine)
+{
+ DefSQClass SQAICargo("AICargo");
+ SQAICargo.PreRegister(engine);
+ SQAICargo.AddConstructor(engine, "x");
+
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_PASSENGERS, "CC_PASSENGERS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_MAIL, "CC_MAIL");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_EXPRESS, "CC_EXPRESS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_ARMOURED, "CC_ARMOURED");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_BULK, "CC_BULK");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_PIECE_GOODS, "CC_PIECE_GOODS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_LIQUID, "CC_LIQUID");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_REFRIGERATED, "CC_REFRIGERATED");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_HAZARDOUS, "CC_HAZARDOUS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CC_COVERED, "CC_COVERED");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_NONE, "TE_NONE");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_PASSENGERS, "TE_PASSENGERS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_MAIL, "TE_MAIL");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_GOODS, "TE_GOODS");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_WATER, "TE_WATER");
+ SQAICargo.DefSQConst(engine, ScriptCargo::TE_FOOD, "TE_FOOD");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CT_AUTO_REFIT, "CT_AUTO_REFIT");
+ SQAICargo.DefSQConst(engine, ScriptCargo::CT_NO_REFIT, "CT_NO_REFIT");
+
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsValidCargo, "IsValidCargo", 2, ".i");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsValidTownEffect, "IsValidTownEffect", 2, ".i");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetCargoLabel, "GetCargoLabel", 2, ".i");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::IsFreight, "IsFreight", 2, ".i");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::HasCargoClass, "HasCargoClass", 3, ".ii");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetTownEffect, "GetTownEffect", 2, ".i");
+ SQAICargo.DefSQStaticMethod(engine, &ScriptCargo::GetCargoIncome, "GetCargoIncome", 4, ".iii");
+
+ SQAICargo.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_cargolist.hpp.sq b/src/script/api/ai/ai_cargolist.hpp.sq
new file mode 100644
index 0000000000..cc1bbc6a28
--- /dev/null
+++ b/src/script/api/ai/ai_cargolist.hpp.sq
@@ -0,0 +1,61 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_cargolist.hpp"
+#include "../template/template_cargolist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AICargoList"; }
+
+void SQAICargoList_Register(Squirrel *engine)
+{
+ DefSQClass SQAICargoList("AICargoList");
+ SQAICargoList.PreRegister(engine, "AIList");
+ SQAICargoList.AddConstructor(engine, "x");
+
+ SQAICargoList.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AICargoList_IndustryAccepting"; }
+
+void SQAICargoList_IndustryAccepting_Register(Squirrel *engine)
+{
+ DefSQClass SQAICargoList_IndustryAccepting("AICargoList_IndustryAccepting");
+ SQAICargoList_IndustryAccepting.PreRegister(engine, "AIList");
+ SQAICargoList_IndustryAccepting.AddConstructor(engine, "xi");
+
+ SQAICargoList_IndustryAccepting.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AICargoList_IndustryProducing"; }
+
+void SQAICargoList_IndustryProducing_Register(Squirrel *engine)
+{
+ DefSQClass SQAICargoList_IndustryProducing("AICargoList_IndustryProducing");
+ SQAICargoList_IndustryProducing.PreRegister(engine, "AIList");
+ SQAICargoList_IndustryProducing.AddConstructor(engine, "xi");
+
+ SQAICargoList_IndustryProducing.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AICargoList_StationAccepting"; }
+
+void SQAICargoList_StationAccepting_Register(Squirrel *engine)
+{
+ DefSQClass SQAICargoList_StationAccepting("AICargoList_StationAccepting");
+ SQAICargoList_StationAccepting.PreRegister(engine, "AIList");
+ SQAICargoList_StationAccepting.AddConstructor(engine, "xi");
+
+ SQAICargoList_StationAccepting.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_company.hpp.sq b/src/script/api/ai/ai_company.hpp.sq
similarity index 67%
rename from src/ai/api/ai_company.hpp.sq
rename to src/script/api/ai/ai_company.hpp.sq
index ffc1fc7bb3..a68cf5d7f2 100644
--- a/src/ai/api/ai_company.hpp.sq
+++ b/src/script/api/ai/ai_company.hpp.sq
@@ -9,24 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_company.hpp"
+#include "../script_company.hpp"
+#include "../template/template_company.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptCompany::Quarter GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Quarter)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptCompany::Quarter res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptCompany::CompanyID GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::CompanyID)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptCompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptCompany::Gender GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptCompany::Gender)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptCompany::Gender res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptCompany to be used as Squirrel parameter */
- template <> inline ScriptCompany *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptCompany *)instance; }
- template <> inline ScriptCompany &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; }
- template <> inline const ScriptCompany *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptCompany *)instance; }
- template <> inline const ScriptCompany &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptCompany *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptCompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Company", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AICompany"; }
diff --git a/src/ai/api/ai_controller.hpp.sq b/src/script/api/ai/ai_controller.hpp.sq
similarity index 97%
rename from src/ai/api/ai_controller.hpp.sq
rename to src/script/api/ai/ai_controller.hpp.sq
index a250f541f2..57f8e7b602 100644
--- a/src/ai/api/ai_controller.hpp.sq
+++ b/src/script/api/ai/ai_controller.hpp.sq
@@ -7,7 +7,7 @@
* 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 .
*/
-#include "../../script/api/script_controller.hpp"
+#include "../script_controller.hpp"
template <> const char *GetClassName() { return "AIController"; }
diff --git a/src/script/api/ai/ai_date.hpp.sq b/src/script/api/ai/ai_date.hpp.sq
new file mode 100644
index 0000000000..3210a6950f
--- /dev/null
+++ b/src/script/api/ai/ai_date.hpp.sq
@@ -0,0 +1,31 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_date.hpp"
+#include "../template/template_date.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIDate"; }
+
+void SQAIDate_Register(Squirrel *engine)
+{
+ DefSQClass SQAIDate("AIDate");
+ SQAIDate.PreRegister(engine);
+ SQAIDate.AddConstructor(engine, "x");
+
+ SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetCurrentDate, "GetCurrentDate", 1, ".");
+ SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetYear, "GetYear", 2, ".i");
+ SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetMonth, "GetMonth", 2, ".i");
+ SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetDayOfMonth, "GetDayOfMonth", 2, ".i");
+ SQAIDate.DefSQStaticMethod(engine, &ScriptDate::GetDate, "GetDate", 4, ".iii");
+
+ SQAIDate.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_depotlist.hpp.sq b/src/script/api/ai/ai_depotlist.hpp.sq
new file mode 100644
index 0000000000..528683ce37
--- /dev/null
+++ b/src/script/api/ai/ai_depotlist.hpp.sq
@@ -0,0 +1,25 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_depotlist.hpp"
+#include "../template/template_depotlist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIDepotList"; }
+
+void SQAIDepotList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIDepotList("AIDepotList");
+ SQAIDepotList.PreRegister(engine, "AIList");
+ SQAIDepotList.AddConstructor(engine, "xi");
+
+ SQAIDepotList.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_engine.hpp.sq b/src/script/api/ai/ai_engine.hpp.sq
similarity index 72%
rename from src/ai/api/ai_engine.hpp.sq
rename to src/script/api/ai/ai_engine.hpp.sq
index 7fc612323b..676435852a 100644
--- a/src/ai/api/ai_engine.hpp.sq
+++ b/src/script/api/ai/ai_engine.hpp.sq
@@ -9,16 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_engine.hpp"
+#include "../script_engine.hpp"
+#include "../template/template_engine.hpp.sq"
-namespace SQConvert {
- /* Allow ScriptEngine to be used as Squirrel parameter */
- template <> inline ScriptEngine *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEngine *)instance; }
- template <> inline ScriptEngine &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngine *)instance; }
- template <> inline const ScriptEngine *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEngine *)instance; }
- template <> inline const ScriptEngine &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEngine *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptEngine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Engine", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIEngine"; }
diff --git a/src/script/api/ai/ai_enginelist.hpp.sq b/src/script/api/ai/ai_enginelist.hpp.sq
new file mode 100644
index 0000000000..8ddc2e7ad1
--- /dev/null
+++ b/src/script/api/ai/ai_enginelist.hpp.sq
@@ -0,0 +1,25 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_enginelist.hpp"
+#include "../template/template_enginelist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIEngineList"; }
+
+void SQAIEngineList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEngineList("AIEngineList");
+ SQAIEngineList.PreRegister(engine, "AIList");
+ SQAIEngineList.AddConstructor(engine, "xi");
+
+ SQAIEngineList.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_error.hpp.sq b/src/script/api/ai/ai_error.hpp.sq
similarity index 82%
rename from src/ai/api/ai_error.hpp.sq
rename to src/script/api/ai/ai_error.hpp.sq
index a1b35956ab..b0f48033a7 100644
--- a/src/ai/api/ai_error.hpp.sq
+++ b/src/script/api/ai/ai_error.hpp.sq
@@ -9,22 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_error.hpp"
+#include "../script_error.hpp"
+#include "../template/template_error.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptError::ErrorCategories GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptError::ErrorCategories)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptError::ErrorCategories res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptError::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptError::ErrorMessages)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptError::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptError to be used as Squirrel parameter */
- template <> inline ScriptError *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptError *)instance; }
- template <> inline ScriptError &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptError *)instance; }
- template <> inline const ScriptError *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptError *)instance; }
- template <> inline const ScriptError &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptError *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptError *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Error", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIError"; }
diff --git a/src/ai/api/ai_event.hpp.sq b/src/script/api/ai/ai_event.hpp.sq
similarity index 56%
rename from src/ai/api/ai_event.hpp.sq
rename to src/script/api/ai/ai_event.hpp.sq
index 1859ff30ba..b30e38e194 100644
--- a/src/ai/api/ai_event.hpp.sq
+++ b/src/script/api/ai/ai_event.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_event.hpp"
+#include "../script_event.hpp"
+#include "../template/template_event.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptEvent::ScriptEventType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptEvent::ScriptEventType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptEvent::ScriptEventType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptEvent to be used as Squirrel parameter */
- template <> inline ScriptEvent *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEvent *)instance; }
- template <> inline ScriptEvent &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEvent *)instance; }
- template <> inline const ScriptEvent *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEvent *)instance; }
- template <> inline const ScriptEvent &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEvent *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptEvent *res) { if (res == NULL) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, "Event", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIEvent"; }
@@ -61,14 +50,6 @@ void SQAIEvent_Register(Squirrel *engine)
SQAIEvent.PostRegister(engine);
}
-namespace SQConvert {
- /* Allow ScriptEventController to be used as Squirrel parameter */
- template <> inline ScriptEventController *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEventController *)instance; }
- template <> inline ScriptEventController &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventController *)instance; }
- template <> inline const ScriptEventController *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptEventController *)instance; }
- template <> inline const ScriptEventController &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptEventController *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptEventController *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "EventController", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIEventController"; }
diff --git a/src/script/api/ai/ai_event_types.hpp.sq b/src/script/api/ai/ai_event_types.hpp.sq
new file mode 100644
index 0000000000..5bdbaccf1c
--- /dev/null
+++ b/src/script/api/ai/ai_event_types.hpp.sq
@@ -0,0 +1,348 @@
+/* $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 .
+ */
+
+/* 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() { return "AIEventVehicleCrashed"; }
+
+void SQAIEventVehicleCrashed_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventVehicleCrashed("AIEventVehicleCrashed");
+ SQAIEventVehicleCrashed.PreRegister(engine, "AIEvent");
+
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_TRAIN, "CRASH_TRAIN");
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_RV_LEVEL_CROSSING, "CRASH_RV_LEVEL_CROSSING");
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_RV_UFO, "CRASH_RV_UFO");
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_PLANE_LANDING, "CRASH_PLANE_LANDING");
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_AIRCRAFT_NO_AIRPORT, "CRASH_AIRCRAFT_NO_AIRPORT");
+ SQAIEventVehicleCrashed.DefSQConst(engine, ScriptEventVehicleCrashed::CRASH_FLOODED, "CRASH_FLOODED");
+
+ SQAIEventVehicleCrashed.DefSQStaticMethod(engine, &ScriptEventVehicleCrashed::Convert, "Convert", 2, ".x");
+
+ SQAIEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetVehicleID, "GetVehicleID", 1, "x");
+ SQAIEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetCrashSite, "GetCrashSite", 1, "x");
+ SQAIEventVehicleCrashed.DefSQMethod(engine, &ScriptEventVehicleCrashed::GetCrashReason, "GetCrashReason", 1, "x");
+
+ SQAIEventVehicleCrashed.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventSubsidyOffer"; }
+
+void SQAIEventSubsidyOffer_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventSubsidyOffer("AIEventSubsidyOffer");
+ SQAIEventSubsidyOffer.PreRegister(engine, "AIEvent");
+
+ SQAIEventSubsidyOffer.DefSQStaticMethod(engine, &ScriptEventSubsidyOffer::Convert, "Convert", 2, ".x");
+
+ SQAIEventSubsidyOffer.DefSQMethod(engine, &ScriptEventSubsidyOffer::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQAIEventSubsidyOffer.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventSubsidyOfferExpired"; }
+
+void SQAIEventSubsidyOfferExpired_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventSubsidyOfferExpired("AIEventSubsidyOfferExpired");
+ SQAIEventSubsidyOfferExpired.PreRegister(engine, "AIEvent");
+
+ SQAIEventSubsidyOfferExpired.DefSQStaticMethod(engine, &ScriptEventSubsidyOfferExpired::Convert, "Convert", 2, ".x");
+
+ SQAIEventSubsidyOfferExpired.DefSQMethod(engine, &ScriptEventSubsidyOfferExpired::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQAIEventSubsidyOfferExpired.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventSubsidyAwarded"; }
+
+void SQAIEventSubsidyAwarded_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventSubsidyAwarded("AIEventSubsidyAwarded");
+ SQAIEventSubsidyAwarded.PreRegister(engine, "AIEvent");
+
+ SQAIEventSubsidyAwarded.DefSQStaticMethod(engine, &ScriptEventSubsidyAwarded::Convert, "Convert", 2, ".x");
+
+ SQAIEventSubsidyAwarded.DefSQMethod(engine, &ScriptEventSubsidyAwarded::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQAIEventSubsidyAwarded.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventSubsidyExpired"; }
+
+void SQAIEventSubsidyExpired_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventSubsidyExpired("AIEventSubsidyExpired");
+ SQAIEventSubsidyExpired.PreRegister(engine, "AIEvent");
+
+ SQAIEventSubsidyExpired.DefSQStaticMethod(engine, &ScriptEventSubsidyExpired::Convert, "Convert", 2, ".x");
+
+ SQAIEventSubsidyExpired.DefSQMethod(engine, &ScriptEventSubsidyExpired::GetSubsidyID, "GetSubsidyID", 1, "x");
+
+ SQAIEventSubsidyExpired.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventEnginePreview"; }
+
+void SQAIEventEnginePreview_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventEnginePreview("AIEventEnginePreview");
+ SQAIEventEnginePreview.PreRegister(engine, "AIEvent");
+
+ SQAIEventEnginePreview.DefSQStaticMethod(engine, &ScriptEventEnginePreview::Convert, "Convert", 2, ".x");
+
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetName, "GetName", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetCargoType, "GetCargoType", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetCapacity, "GetCapacity", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetMaxSpeed, "GetMaxSpeed", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetPrice, "GetPrice", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetRunningCost, "GetRunningCost", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::GetVehicleType, "GetVehicleType", 1, "x");
+ SQAIEventEnginePreview.DefSQMethod(engine, &ScriptEventEnginePreview::AcceptPreview, "AcceptPreview", 1, "x");
+
+ SQAIEventEnginePreview.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventCompanyNew"; }
+
+void SQAIEventCompanyNew_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventCompanyNew("AIEventCompanyNew");
+ SQAIEventCompanyNew.PreRegister(engine, "AIEvent");
+
+ SQAIEventCompanyNew.DefSQStaticMethod(engine, &ScriptEventCompanyNew::Convert, "Convert", 2, ".x");
+
+ SQAIEventCompanyNew.DefSQMethod(engine, &ScriptEventCompanyNew::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQAIEventCompanyNew.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventCompanyInTrouble"; }
+
+void SQAIEventCompanyInTrouble_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventCompanyInTrouble("AIEventCompanyInTrouble");
+ SQAIEventCompanyInTrouble.PreRegister(engine, "AIEvent");
+
+ SQAIEventCompanyInTrouble.DefSQStaticMethod(engine, &ScriptEventCompanyInTrouble::Convert, "Convert", 2, ".x");
+
+ SQAIEventCompanyInTrouble.DefSQMethod(engine, &ScriptEventCompanyInTrouble::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQAIEventCompanyInTrouble.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventCompanyAskMerger"; }
+
+void SQAIEventCompanyAskMerger_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventCompanyAskMerger("AIEventCompanyAskMerger");
+ SQAIEventCompanyAskMerger.PreRegister(engine, "AIEvent");
+
+ SQAIEventCompanyAskMerger.DefSQStaticMethod(engine, &ScriptEventCompanyAskMerger::Convert, "Convert", 2, ".x");
+
+ SQAIEventCompanyAskMerger.DefSQMethod(engine, &ScriptEventCompanyAskMerger::GetCompanyID, "GetCompanyID", 1, "x");
+ SQAIEventCompanyAskMerger.DefSQMethod(engine, &ScriptEventCompanyAskMerger::GetValue, "GetValue", 1, "x");
+ SQAIEventCompanyAskMerger.DefSQMethod(engine, &ScriptEventCompanyAskMerger::AcceptMerger, "AcceptMerger", 1, "x");
+
+ SQAIEventCompanyAskMerger.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventCompanyMerger"; }
+
+void SQAIEventCompanyMerger_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventCompanyMerger("AIEventCompanyMerger");
+ SQAIEventCompanyMerger.PreRegister(engine, "AIEvent");
+
+ SQAIEventCompanyMerger.DefSQStaticMethod(engine, &ScriptEventCompanyMerger::Convert, "Convert", 2, ".x");
+
+ SQAIEventCompanyMerger.DefSQMethod(engine, &ScriptEventCompanyMerger::GetOldCompanyID, "GetOldCompanyID", 1, "x");
+ SQAIEventCompanyMerger.DefSQMethod(engine, &ScriptEventCompanyMerger::GetNewCompanyID, "GetNewCompanyID", 1, "x");
+
+ SQAIEventCompanyMerger.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventCompanyBankrupt"; }
+
+void SQAIEventCompanyBankrupt_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventCompanyBankrupt("AIEventCompanyBankrupt");
+ SQAIEventCompanyBankrupt.PreRegister(engine, "AIEvent");
+
+ SQAIEventCompanyBankrupt.DefSQStaticMethod(engine, &ScriptEventCompanyBankrupt::Convert, "Convert", 2, ".x");
+
+ SQAIEventCompanyBankrupt.DefSQMethod(engine, &ScriptEventCompanyBankrupt::GetCompanyID, "GetCompanyID", 1, "x");
+
+ SQAIEventCompanyBankrupt.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventVehicleLost"; }
+
+void SQAIEventVehicleLost_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventVehicleLost("AIEventVehicleLost");
+ SQAIEventVehicleLost.PreRegister(engine, "AIEvent");
+
+ SQAIEventVehicleLost.DefSQStaticMethod(engine, &ScriptEventVehicleLost::Convert, "Convert", 2, ".x");
+
+ SQAIEventVehicleLost.DefSQMethod(engine, &ScriptEventVehicleLost::GetVehicleID, "GetVehicleID", 1, "x");
+
+ SQAIEventVehicleLost.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventVehicleWaitingInDepot"; }
+
+void SQAIEventVehicleWaitingInDepot_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventVehicleWaitingInDepot("AIEventVehicleWaitingInDepot");
+ SQAIEventVehicleWaitingInDepot.PreRegister(engine, "AIEvent");
+
+ SQAIEventVehicleWaitingInDepot.DefSQStaticMethod(engine, &ScriptEventVehicleWaitingInDepot::Convert, "Convert", 2, ".x");
+
+ SQAIEventVehicleWaitingInDepot.DefSQMethod(engine, &ScriptEventVehicleWaitingInDepot::GetVehicleID, "GetVehicleID", 1, "x");
+
+ SQAIEventVehicleWaitingInDepot.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventVehicleUnprofitable"; }
+
+void SQAIEventVehicleUnprofitable_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventVehicleUnprofitable("AIEventVehicleUnprofitable");
+ SQAIEventVehicleUnprofitable.PreRegister(engine, "AIEvent");
+
+ SQAIEventVehicleUnprofitable.DefSQStaticMethod(engine, &ScriptEventVehicleUnprofitable::Convert, "Convert", 2, ".x");
+
+ SQAIEventVehicleUnprofitable.DefSQMethod(engine, &ScriptEventVehicleUnprofitable::GetVehicleID, "GetVehicleID", 1, "x");
+
+ SQAIEventVehicleUnprofitable.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventIndustryOpen"; }
+
+void SQAIEventIndustryOpen_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventIndustryOpen("AIEventIndustryOpen");
+ SQAIEventIndustryOpen.PreRegister(engine, "AIEvent");
+
+ SQAIEventIndustryOpen.DefSQStaticMethod(engine, &ScriptEventIndustryOpen::Convert, "Convert", 2, ".x");
+
+ SQAIEventIndustryOpen.DefSQMethod(engine, &ScriptEventIndustryOpen::GetIndustryID, "GetIndustryID", 1, "x");
+
+ SQAIEventIndustryOpen.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventIndustryClose"; }
+
+void SQAIEventIndustryClose_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventIndustryClose("AIEventIndustryClose");
+ SQAIEventIndustryClose.PreRegister(engine, "AIEvent");
+
+ SQAIEventIndustryClose.DefSQStaticMethod(engine, &ScriptEventIndustryClose::Convert, "Convert", 2, ".x");
+
+ SQAIEventIndustryClose.DefSQMethod(engine, &ScriptEventIndustryClose::GetIndustryID, "GetIndustryID", 1, "x");
+
+ SQAIEventIndustryClose.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventEngineAvailable"; }
+
+void SQAIEventEngineAvailable_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventEngineAvailable("AIEventEngineAvailable");
+ SQAIEventEngineAvailable.PreRegister(engine, "AIEvent");
+
+ SQAIEventEngineAvailable.DefSQStaticMethod(engine, &ScriptEventEngineAvailable::Convert, "Convert", 2, ".x");
+
+ SQAIEventEngineAvailable.DefSQMethod(engine, &ScriptEventEngineAvailable::GetEngineID, "GetEngineID", 1, "x");
+
+ SQAIEventEngineAvailable.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventStationFirstVehicle"; }
+
+void SQAIEventStationFirstVehicle_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventStationFirstVehicle("AIEventStationFirstVehicle");
+ SQAIEventStationFirstVehicle.PreRegister(engine, "AIEvent");
+
+ SQAIEventStationFirstVehicle.DefSQStaticMethod(engine, &ScriptEventStationFirstVehicle::Convert, "Convert", 2, ".x");
+
+ SQAIEventStationFirstVehicle.DefSQMethod(engine, &ScriptEventStationFirstVehicle::GetStationID, "GetStationID", 1, "x");
+ SQAIEventStationFirstVehicle.DefSQMethod(engine, &ScriptEventStationFirstVehicle::GetVehicleID, "GetVehicleID", 1, "x");
+
+ SQAIEventStationFirstVehicle.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventDisasterZeppelinerCrashed"; }
+
+void SQAIEventDisasterZeppelinerCrashed_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventDisasterZeppelinerCrashed("AIEventDisasterZeppelinerCrashed");
+ SQAIEventDisasterZeppelinerCrashed.PreRegister(engine, "AIEvent");
+
+ SQAIEventDisasterZeppelinerCrashed.DefSQStaticMethod(engine, &ScriptEventDisasterZeppelinerCrashed::Convert, "Convert", 2, ".x");
+
+ SQAIEventDisasterZeppelinerCrashed.DefSQMethod(engine, &ScriptEventDisasterZeppelinerCrashed::GetStationID, "GetStationID", 1, "x");
+
+ SQAIEventDisasterZeppelinerCrashed.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventDisasterZeppelinerCleared"; }
+
+void SQAIEventDisasterZeppelinerCleared_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventDisasterZeppelinerCleared("AIEventDisasterZeppelinerCleared");
+ SQAIEventDisasterZeppelinerCleared.PreRegister(engine, "AIEvent");
+
+ SQAIEventDisasterZeppelinerCleared.DefSQStaticMethod(engine, &ScriptEventDisasterZeppelinerCleared::Convert, "Convert", 2, ".x");
+
+ SQAIEventDisasterZeppelinerCleared.DefSQMethod(engine, &ScriptEventDisasterZeppelinerCleared::GetStationID, "GetStationID", 1, "x");
+
+ SQAIEventDisasterZeppelinerCleared.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIEventTownFounded"; }
+
+void SQAIEventTownFounded_Register(Squirrel *engine)
+{
+ DefSQClass SQAIEventTownFounded("AIEventTownFounded");
+ SQAIEventTownFounded.PreRegister(engine, "AIEvent");
+
+ SQAIEventTownFounded.DefSQStaticMethod(engine, &ScriptEventTownFounded::Convert, "Convert", 2, ".x");
+
+ SQAIEventTownFounded.DefSQMethod(engine, &ScriptEventTownFounded::GetTownID, "GetTownID", 1, "x");
+
+ SQAIEventTownFounded.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_execmode.hpp.sq b/src/script/api/ai/ai_execmode.hpp.sq
new file mode 100644
index 0000000000..869f3fe932
--- /dev/null
+++ b/src/script/api/ai/ai_execmode.hpp.sq
@@ -0,0 +1,25 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_execmode.hpp"
+#include "../template/template_execmode.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIExecMode"; }
+
+void SQAIExecMode_Register(Squirrel *engine)
+{
+ DefSQClass SQAIExecMode("AIExecMode");
+ SQAIExecMode.PreRegister(engine);
+ SQAIExecMode.AddConstructor(engine, "x");
+
+ SQAIExecMode.PostRegister(engine);
+}
diff --git a/src/script/api/ai/ai_gamesettings.hpp.sq b/src/script/api/ai/ai_gamesettings.hpp.sq
new file mode 100644
index 0000000000..1459b031d7
--- /dev/null
+++ b/src/script/api/ai/ai_gamesettings.hpp.sq
@@ -0,0 +1,29 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_gamesettings.hpp"
+#include "../template/template_gamesettings.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIGameSettings"; }
+
+void SQAIGameSettings_Register(Squirrel *engine)
+{
+ DefSQClass SQAIGameSettings("AIGameSettings");
+ SQAIGameSettings.PreRegister(engine);
+ SQAIGameSettings.AddConstructor(engine, "x");
+
+ SQAIGameSettings.DefSQStaticMethod(engine, &ScriptGameSettings::IsValid, "IsValid", 2, "..");
+ SQAIGameSettings.DefSQStaticMethod(engine, &ScriptGameSettings::GetValue, "GetValue", 2, "..");
+ SQAIGameSettings.DefSQStaticMethod(engine, &ScriptGameSettings::IsDisabledVehicleType, "IsDisabledVehicleType", 2, ".i");
+
+ SQAIGameSettings.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_group.hpp.sq b/src/script/api/ai/ai_group.hpp.sq
similarity index 63%
rename from src/ai/api/ai_group.hpp.sq
rename to src/script/api/ai/ai_group.hpp.sq
index d4e696d5d2..52ade08d56 100644
--- a/src/ai/api/ai_group.hpp.sq
+++ b/src/script/api/ai/ai_group.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_group.hpp"
+#include "../script_group.hpp"
+#include "../template/template_group.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptGroup::GroupID GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptGroup::GroupID)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptGroup::GroupID res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptGroup to be used as Squirrel parameter */
- template <> inline ScriptGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptGroup *)instance; }
- template <> inline ScriptGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGroup *)instance; }
- template <> inline const ScriptGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptGroup *)instance; }
- template <> inline const ScriptGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGroup *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptGroup *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Group", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIGroup"; }
diff --git a/src/script/api/ai/ai_grouplist.hpp.sq b/src/script/api/ai/ai_grouplist.hpp.sq
new file mode 100644
index 0000000000..9f9f2dab25
--- /dev/null
+++ b/src/script/api/ai/ai_grouplist.hpp.sq
@@ -0,0 +1,25 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_grouplist.hpp"
+#include "../template/template_grouplist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIGroupList"; }
+
+void SQAIGroupList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIGroupList("AIGroupList");
+ SQAIGroupList.PreRegister(engine, "AIList");
+ SQAIGroupList.AddConstructor(engine, "x");
+
+ SQAIGroupList.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_industry.hpp.sq b/src/script/api/ai/ai_industry.hpp.sq
similarity index 67%
rename from src/ai/api/ai_industry.hpp.sq
rename to src/script/api/ai/ai_industry.hpp.sq
index 11db2f6fb7..4de03f1dab 100644
--- a/src/ai/api/ai_industry.hpp.sq
+++ b/src/script/api/ai/ai_industry.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_industry.hpp"
+#include "../script_industry.hpp"
+#include "../template/template_industry.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptIndustry::CargoAcceptState GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptIndustry::CargoAcceptState)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptIndustry::CargoAcceptState res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptIndustry to be used as Squirrel parameter */
- template <> inline ScriptIndustry *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptIndustry *)instance; }
- template <> inline ScriptIndustry &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptIndustry *)instance; }
- template <> inline const ScriptIndustry *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptIndustry *)instance; }
- template <> inline const ScriptIndustry &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptIndustry *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptIndustry *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Industry", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIIndustry"; }
diff --git a/src/script/api/ai/ai_industrylist.hpp.sq b/src/script/api/ai/ai_industrylist.hpp.sq
new file mode 100644
index 0000000000..0ae7e97799
--- /dev/null
+++ b/src/script/api/ai/ai_industrylist.hpp.sq
@@ -0,0 +1,49 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_industrylist.hpp"
+#include "../template/template_industrylist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIIndustryList"; }
+
+void SQAIIndustryList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIIndustryList("AIIndustryList");
+ SQAIIndustryList.PreRegister(engine, "AIList");
+ SQAIIndustryList.AddConstructor(engine, "x");
+
+ SQAIIndustryList.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIIndustryList_CargoAccepting"; }
+
+void SQAIIndustryList_CargoAccepting_Register(Squirrel *engine)
+{
+ DefSQClass SQAIIndustryList_CargoAccepting("AIIndustryList_CargoAccepting");
+ SQAIIndustryList_CargoAccepting.PreRegister(engine, "AIList");
+ SQAIIndustryList_CargoAccepting.AddConstructor(engine, "xi");
+
+ SQAIIndustryList_CargoAccepting.PostRegister(engine);
+}
+
+
+template <> const char *GetClassName() { return "AIIndustryList_CargoProducing"; }
+
+void SQAIIndustryList_CargoProducing_Register(Squirrel *engine)
+{
+ DefSQClass SQAIIndustryList_CargoProducing("AIIndustryList_CargoProducing");
+ SQAIIndustryList_CargoProducing.PreRegister(engine, "AIList");
+ SQAIIndustryList_CargoProducing.AddConstructor(engine, "xi");
+
+ SQAIIndustryList_CargoProducing.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_industrytype.hpp.sq b/src/script/api/ai/ai_industrytype.hpp.sq
similarity index 60%
rename from src/ai/api/ai_industrytype.hpp.sq
rename to src/script/api/ai/ai_industrytype.hpp.sq
index 468b3d829b..fe84b70f96 100644
--- a/src/ai/api/ai_industrytype.hpp.sq
+++ b/src/script/api/ai/ai_industrytype.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_industrytype.hpp"
+#include "../script_industrytype.hpp"
+#include "../template/template_industrytype.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptIndustryType::SpecialIndustryType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptIndustryType::SpecialIndustryType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptIndustryType::SpecialIndustryType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptIndustryType to be used as Squirrel parameter */
- template <> inline ScriptIndustryType *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptIndustryType *)instance; }
- template <> inline ScriptIndustryType &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptIndustryType *)instance; }
- template <> inline const ScriptIndustryType *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptIndustryType *)instance; }
- template <> inline const ScriptIndustryType &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptIndustryType *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptIndustryType *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "IndustryType", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIIndustryType"; }
diff --git a/src/script/api/ai/ai_industrytypelist.hpp.sq b/src/script/api/ai/ai_industrytypelist.hpp.sq
new file mode 100644
index 0000000000..6ac836b390
--- /dev/null
+++ b/src/script/api/ai/ai_industrytypelist.hpp.sq
@@ -0,0 +1,25 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_industrytypelist.hpp"
+#include "../template/template_industrytypelist.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AIIndustryTypeList"; }
+
+void SQAIIndustryTypeList_Register(Squirrel *engine)
+{
+ DefSQClass SQAIIndustryTypeList("AIIndustryTypeList");
+ SQAIIndustryTypeList.PreRegister(engine, "AIList");
+ SQAIIndustryTypeList.AddConstructor(engine, "x");
+
+ SQAIIndustryTypeList.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_list.hpp.sq b/src/script/api/ai/ai_list.hpp.sq
similarity index 70%
rename from src/ai/api/ai_list.hpp.sq
rename to src/script/api/ai/ai_list.hpp.sq
index a44a71293c..db724da831 100644
--- a/src/ai/api/ai_list.hpp.sq
+++ b/src/script/api/ai/ai_list.hpp.sq
@@ -9,20 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_list.hpp"
+#include "../script_list.hpp"
+#include "../template/template_list.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptList::SorterType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptList::SorterType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptList::SorterType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptList to be used as Squirrel parameter */
- template <> inline ScriptList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptList *)instance; }
- template <> inline ScriptList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptList *)instance; }
- template <> inline const ScriptList *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptList *)instance; }
- template <> inline const ScriptList &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptList *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "List", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIList"; }
diff --git a/src/script/api/ai/ai_log.hpp.sq b/src/script/api/ai/ai_log.hpp.sq
new file mode 100644
index 0000000000..174ac2b929
--- /dev/null
+++ b/src/script/api/ai/ai_log.hpp.sq
@@ -0,0 +1,29 @@
+/* $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 .
+ */
+
+/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
+
+#include "../script_log.hpp"
+#include "../template/template_log.hpp.sq"
+
+
+template <> const char *GetClassName() { return "AILog"; }
+
+void SQAILog_Register(Squirrel *engine)
+{
+ DefSQClass SQAILog("AILog");
+ SQAILog.PreRegister(engine);
+ SQAILog.AddConstructor(engine, "x");
+
+ SQAILog.DefSQStaticMethod(engine, &ScriptLog::Info, "Info", 2, "..");
+ SQAILog.DefSQStaticMethod(engine, &ScriptLog::Warning, "Warning", 2, "..");
+ SQAILog.DefSQStaticMethod(engine, &ScriptLog::Error, "Error", 2, "..");
+
+ SQAILog.PostRegister(engine);
+}
diff --git a/src/ai/api/ai_map.hpp.sq b/src/script/api/ai/ai_map.hpp.sq
similarity index 61%
rename from src/ai/api/ai_map.hpp.sq
rename to src/script/api/ai/ai_map.hpp.sq
index 098c24773f..f0f1cbed0c 100644
--- a/src/ai/api/ai_map.hpp.sq
+++ b/src/script/api/ai/ai_map.hpp.sq
@@ -9,16 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_map.hpp"
+#include "../script_map.hpp"
+#include "../template/template_map.hpp.sq"
-namespace SQConvert {
- /* Allow ScriptMap to be used as Squirrel parameter */
- template <> inline ScriptMap *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptMap *)instance; }
- template <> inline ScriptMap &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptMap *)instance; }
- template <> inline const ScriptMap *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptMap *)instance; }
- template <> inline const ScriptMap &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptMap *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptMap *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Map", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIMap"; }
diff --git a/src/ai/api/ai_marine.hpp.sq b/src/script/api/ai/ai_marine.hpp.sq
similarity index 62%
rename from src/ai/api/ai_marine.hpp.sq
rename to src/script/api/ai/ai_marine.hpp.sq
index 9313764552..843c3d8746 100644
--- a/src/ai/api/ai_marine.hpp.sq
+++ b/src/script/api/ai/ai_marine.hpp.sq
@@ -9,22 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_marine.hpp"
+#include "../script_marine.hpp"
+#include "../template/template_marine.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptMarine::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptMarine::ErrorMessages)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptMarine::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptMarine::BuildType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptMarine::BuildType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptMarine::BuildType res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptMarine to be used as Squirrel parameter */
- template <> inline ScriptMarine *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptMarine *)instance; }
- template <> inline ScriptMarine &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptMarine *)instance; }
- template <> inline const ScriptMarine *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptMarine *)instance; }
- template <> inline const ScriptMarine &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptMarine *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptMarine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Marine", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIMarine"; }
diff --git a/src/ai/api/ai_order.hpp.sq b/src/script/api/ai/ai_order.hpp.sq
similarity index 74%
rename from src/ai/api/ai_order.hpp.sq
rename to src/script/api/ai/ai_order.hpp.sq
index c9a5ce6a00..006424572d 100644
--- a/src/ai/api/ai_order.hpp.sq
+++ b/src/script/api/ai/ai_order.hpp.sq
@@ -9,30 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_order.hpp"
+#include "../script_order.hpp"
+#include "../template/template_order.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptOrder::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::ErrorMessages)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptOrder::ScriptOrderFlags GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::ScriptOrderFlags)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::ScriptOrderFlags res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptOrder::OrderCondition GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::OrderCondition)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::OrderCondition res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptOrder::CompareFunction GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::CompareFunction)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::CompareFunction res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptOrder::OrderPosition GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::OrderPosition)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::OrderPosition res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptOrder::StopLocation GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptOrder::StopLocation)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder::StopLocation res) { sq_pushinteger(vm, (int32)res); return 1; }
-
- /* Allow ScriptOrder to be used as Squirrel parameter */
- template <> inline ScriptOrder *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptOrder *)instance; }
- template <> inline ScriptOrder &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptOrder *)instance; }
- template <> inline const ScriptOrder *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptOrder *)instance; }
- template <> inline const ScriptOrder &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptOrder *)instance; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptOrder *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Order", res, NULL, DefSQDestructorCallback, true); return 1; }
-} // namespace SQConvert
template <> const char *GetClassName() { return "AIOrder"; }
diff --git a/src/ai/api/ai_rail.hpp.sq b/src/script/api/ai/ai_rail.hpp.sq
similarity index 72%
rename from src/ai/api/ai_rail.hpp.sq
rename to src/script/api/ai/ai_rail.hpp.sq
index 84df36e104..85d15f0ff4 100644
--- a/src/ai/api/ai_rail.hpp.sq
+++ b/src/script/api/ai/ai_rail.hpp.sq
@@ -9,28 +9,9 @@
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
-#include "../../script/api/script_rail.hpp"
+#include "../script_rail.hpp"
+#include "../template/template_rail.hpp.sq"
-namespace SQConvert {
- /* Allow enums to be used as Squirrel parameters */
- template <> inline ScriptRail::ErrorMessages GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptRail::ErrorMessages)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptRail::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptRail::RailType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptRail::RailType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptRail::RailType res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptRail::RailTrack GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptRail::RailTrack)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptRail::RailTrack res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptRail::SignalType GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptRail::SignalType)tmp; }
- template <> inline int Return(HSQUIRRELVM vm, ScriptRail::SignalType res) { sq_pushinteger(vm, (int32)res); return 1; }
- template <> inline ScriptRail::BuildType GetParam(ForceType