From 3f7eb71b17da7840678c68953729aff156cc500b Mon Sep 17 00:00:00 2001 From: rubidium Date: Sun, 13 Nov 2011 20:52:39 +0000 Subject: (svn r23210) -Codechange: generate the GetClassName function for the AI classes programmatically --- src/ai/ai_scanner.cpp | 2 ++ src/ai/api/ai_accounting.hpp | 3 -- src/ai/api/ai_accounting.hpp.sq | 2 ++ src/ai/api/ai_airport.hpp | 3 -- src/ai/api/ai_airport.hpp.sq | 2 ++ src/ai/api/ai_base.hpp | 3 -- src/ai/api/ai_base.hpp.sq | 2 ++ src/ai/api/ai_basestation.hpp | 3 -- src/ai/api/ai_basestation.hpp.sq | 2 ++ src/ai/api/ai_bridge.hpp | 3 -- src/ai/api/ai_bridge.hpp.sq | 2 ++ src/ai/api/ai_bridgelist.hpp | 5 --- src/ai/api/ai_bridgelist.hpp.sq | 4 +++ src/ai/api/ai_cargo.hpp | 3 -- src/ai/api/ai_cargo.hpp.sq | 2 ++ src/ai/api/ai_cargolist.hpp | 11 ------ src/ai/api/ai_cargolist.hpp.sq | 8 +++++ src/ai/api/ai_company.hpp | 3 -- src/ai/api/ai_company.hpp.sq | 2 ++ src/ai/api/ai_controller.hpp | 3 -- src/ai/api/ai_controller.hpp.sq | 2 ++ src/ai/api/ai_date.hpp | 3 -- src/ai/api/ai_date.hpp.sq | 2 ++ src/ai/api/ai_depotlist.hpp | 3 -- src/ai/api/ai_depotlist.hpp.sq | 2 ++ src/ai/api/ai_engine.hpp | 3 -- src/ai/api/ai_engine.hpp.sq | 2 ++ src/ai/api/ai_enginelist.hpp | 3 -- src/ai/api/ai_enginelist.hpp.sq | 2 ++ src/ai/api/ai_error.hpp | 3 -- src/ai/api/ai_error.hpp.sq | 2 ++ src/ai/api/ai_event.hpp | 9 ----- src/ai/api/ai_event.hpp.sq | 4 +++ src/ai/api/ai_event_types.hpp | 63 ----------------------------------- src/ai/api/ai_event_types.hpp.sq | 42 +++++++++++++++++++++++ src/ai/api/ai_execmode.hpp | 4 --- src/ai/api/ai_execmode.hpp.sq | 2 ++ src/ai/api/ai_gamesettings.hpp | 3 -- src/ai/api/ai_gamesettings.hpp.sq | 2 ++ src/ai/api/ai_group.hpp | 3 -- src/ai/api/ai_group.hpp.sq | 2 ++ src/ai/api/ai_grouplist.hpp | 2 -- src/ai/api/ai_grouplist.hpp.sq | 2 ++ src/ai/api/ai_industry.hpp | 3 -- src/ai/api/ai_industry.hpp.sq | 2 ++ src/ai/api/ai_industrylist.hpp | 8 ----- src/ai/api/ai_industrylist.hpp.sq | 6 ++++ src/ai/api/ai_industrytype.hpp | 3 -- src/ai/api/ai_industrytype.hpp.sq | 2 ++ src/ai/api/ai_industrytypelist.hpp | 2 -- src/ai/api/ai_industrytypelist.hpp.sq | 2 ++ src/ai/api/ai_list.hpp | 3 -- src/ai/api/ai_list.hpp.sq | 2 ++ src/ai/api/ai_log.hpp | 3 -- src/ai/api/ai_log.hpp.sq | 2 ++ src/ai/api/ai_map.hpp | 3 -- src/ai/api/ai_map.hpp.sq | 2 ++ src/ai/api/ai_marine.hpp | 3 -- src/ai/api/ai_marine.hpp.sq | 2 ++ src/ai/api/ai_order.hpp | 3 -- src/ai/api/ai_order.hpp.sq | 2 ++ src/ai/api/ai_rail.hpp | 3 -- src/ai/api/ai_rail.hpp.sq | 2 ++ src/ai/api/ai_railtypelist.hpp | 2 -- src/ai/api/ai_railtypelist.hpp.sq | 2 ++ src/ai/api/ai_road.hpp | 3 -- src/ai/api/ai_road.hpp.sq | 2 ++ src/ai/api/ai_sign.hpp | 3 -- src/ai/api/ai_sign.hpp.sq | 2 ++ src/ai/api/ai_signlist.hpp | 2 -- src/ai/api/ai_signlist.hpp.sq | 2 ++ src/ai/api/ai_station.hpp | 3 -- src/ai/api/ai_station.hpp.sq | 2 ++ src/ai/api/ai_stationlist.hpp | 6 ---- src/ai/api/ai_stationlist.hpp.sq | 4 +++ src/ai/api/ai_subsidy.hpp | 3 -- src/ai/api/ai_subsidy.hpp.sq | 2 ++ src/ai/api/ai_subsidylist.hpp | 2 -- src/ai/api/ai_subsidylist.hpp.sq | 2 ++ src/ai/api/ai_testmode.hpp | 4 --- src/ai/api/ai_testmode.hpp.sq | 2 ++ src/ai/api/ai_tile.hpp | 3 -- src/ai/api/ai_tile.hpp.sq | 2 ++ src/ai/api/ai_tilelist.hpp | 12 ------- src/ai/api/ai_tilelist.hpp.sq | 8 +++++ src/ai/api/ai_town.hpp | 3 -- src/ai/api/ai_town.hpp.sq | 2 ++ src/ai/api/ai_townlist.hpp | 2 -- src/ai/api/ai_townlist.hpp.sq | 2 ++ src/ai/api/ai_tunnel.hpp | 3 -- src/ai/api/ai_tunnel.hpp.sq | 2 ++ src/ai/api/ai_vehicle.hpp | 3 -- src/ai/api/ai_vehicle.hpp.sq | 2 ++ src/ai/api/ai_vehiclelist.hpp | 17 ---------- src/ai/api/ai_vehiclelist.hpp.sq | 12 +++++++ src/ai/api/ai_waypoint.hpp | 3 -- src/ai/api/ai_waypoint.hpp.sq | 2 ++ src/ai/api/ai_waypointlist.hpp | 6 ---- src/ai/api/ai_waypointlist.hpp.sq | 4 +++ src/ai/api/squirrel_export.awk | 4 ++- 100 files changed, 177 insertions(+), 254 deletions(-) (limited to 'src/ai') diff --git a/src/ai/ai_scanner.cpp b/src/ai/ai_scanner.cpp index a3995c01a..c89f9e5fe 100644 --- a/src/ai/ai_scanner.cpp +++ b/src/ai/ai_scanner.cpp @@ -28,6 +28,8 @@ void AIScanner::RescanAIDir() this->Scan(PATHSEP "library.nut", AI_LIBRARY_DIR); } +template <> const char *GetClassName() { return "AIInfo"; } + AIScanner::AIScanner() : ScriptScanner(), info_dummy(NULL) diff --git a/src/ai/api/ai_accounting.hpp b/src/ai/api/ai_accounting.hpp index 976513269..a68571805 100644 --- a/src/ai/api/ai_accounting.hpp +++ b/src/ai/api/ai_accounting.hpp @@ -29,9 +29,6 @@ */ class AIAccounting : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIAccounting"; } - /** * Creating instance of this class starts counting the costs of commands * from zero. Saves the current value of GetCosts so we can return to diff --git a/src/ai/api/ai_accounting.hpp.sq b/src/ai/api/ai_accounting.hpp.sq index 37d65b5d7..1b71acf07 100644 --- a/src/ai/api/ai_accounting.hpp.sq +++ b/src/ai/api/ai_accounting.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIAccounting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIAccounting", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIAccounting"; } + void SQAIAccounting_Register(Squirrel *engine) { DefSQClass SQAIAccounting("AIAccounting"); diff --git a/src/ai/api/ai_airport.hpp b/src/ai/api/ai_airport.hpp index a889b3289..28b870bba 100644 --- a/src/ai/api/ai_airport.hpp +++ b/src/ai/api/ai_airport.hpp @@ -19,9 +19,6 @@ */ class AIAirport : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIAirport"; } - /** * The types of airports available in the game. */ diff --git a/src/ai/api/ai_airport.hpp.sq b/src/ai/api/ai_airport.hpp.sq index c4fa0f9ed..e70dea465 100644 --- a/src/ai/api/ai_airport.hpp.sq +++ b/src/ai/api/ai_airport.hpp.sq @@ -26,6 +26,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIAirport *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIAirport", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIAirport"; } + void SQAIAirport_Register(Squirrel *engine) { DefSQClass SQAIAirport("AIAirport"); diff --git a/src/ai/api/ai_base.hpp b/src/ai/api/ai_base.hpp index 40d7ed94b..a98f2b844 100644 --- a/src/ai/api/ai_base.hpp +++ b/src/ai/api/ai_base.hpp @@ -25,9 +25,6 @@ */ class AIBase : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIBase"; } - /** * Get a random value. * @return A random value between 0 and MAX(uint32). diff --git a/src/ai/api/ai_base.hpp.sq b/src/ai/api/ai_base.hpp.sq index 059e752da..474b257dc 100644 --- a/src/ai/api/ai_base.hpp.sq +++ b/src/ai/api/ai_base.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIBase *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIBase", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIBase"; } + void SQAIBase_Register(Squirrel *engine) { DefSQClass SQAIBase("AIBase"); diff --git a/src/ai/api/ai_basestation.hpp b/src/ai/api/ai_basestation.hpp index 94d698354..d17acf474 100644 --- a/src/ai/api/ai_basestation.hpp +++ b/src/ai/api/ai_basestation.hpp @@ -19,9 +19,6 @@ */ class AIBaseStation : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIBaseStation"; } - /** * Special station IDs for building adjacent/new stations when * the adjacent/distant join features are enabled. diff --git a/src/ai/api/ai_basestation.hpp.sq b/src/ai/api/ai_basestation.hpp.sq index cf1e5e33f..33e184337 100644 --- a/src/ai/api/ai_basestation.hpp.sq +++ b/src/ai/api/ai_basestation.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIBaseStation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIBaseStation", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIBaseStation"; } + void SQAIBaseStation_Register(Squirrel *engine) { DefSQClass SQAIBaseStation("AIBaseStation"); diff --git a/src/ai/api/ai_bridge.hpp b/src/ai/api/ai_bridge.hpp index 92204d123..e3d4eaa10 100644 --- a/src/ai/api/ai_bridge.hpp +++ b/src/ai/api/ai_bridge.hpp @@ -39,9 +39,6 @@ public: ERR_BRIDGE_HEADS_NOT_ON_SAME_HEIGHT, // [STR_ERROR_BRIDGEHEADS_NOT_SAME_HEIGHT] }; - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIBridge"; } - /** * Checks whether the given bridge type is valid. * @param bridge_id The bridge to check. diff --git a/src/ai/api/ai_bridge.hpp.sq b/src/ai/api/ai_bridge.hpp.sq index 2dee58c75..fbb664b67 100644 --- a/src/ai/api/ai_bridge.hpp.sq +++ b/src/ai/api/ai_bridge.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIBridge *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIBridge", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIBridge"; } + void SQAIBridge_Register(Squirrel *engine) { DefSQClass SQAIBridge("AIBridge"); diff --git a/src/ai/api/ai_bridgelist.hpp b/src/ai/api/ai_bridgelist.hpp index 7dd41b221..cae2f82c0 100644 --- a/src/ai/api/ai_bridgelist.hpp +++ b/src/ai/api/ai_bridgelist.hpp @@ -20,8 +20,6 @@ */ class AIBridgeList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIBridgeList"; } AIBridgeList(); }; @@ -31,9 +29,6 @@ public: */ class AIBridgeList_Length : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIBridgeList_Length"; } - /** * @param length The length of the bridge you want to build. */ diff --git a/src/ai/api/ai_bridgelist.hpp.sq b/src/ai/api/ai_bridgelist.hpp.sq index 82cd49049..47ad5f77e 100644 --- a/src/ai/api/ai_bridgelist.hpp.sq +++ b/src/ai/api/ai_bridgelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIBridgeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIBridgeList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIBridgeList"; } + void SQAIBridgeList_Register(Squirrel *engine) { DefSQClass SQAIBridgeList("AIBridgeList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIBridgeList_Length *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIBridgeList_Length", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIBridgeList_Length"; } + void SQAIBridgeList_Length_Register(Squirrel *engine) { DefSQClass SQAIBridgeList_Length("AIBridgeList_Length"); diff --git a/src/ai/api/ai_cargo.hpp b/src/ai/api/ai_cargo.hpp index 4cc3a1a1c..ed658c0a4 100644 --- a/src/ai/api/ai_cargo.hpp +++ b/src/ai/api/ai_cargo.hpp @@ -19,9 +19,6 @@ */ class AICargo : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICargo"; } - /** * The classes of cargo (from newgrf_cargo.h). */ diff --git a/src/ai/api/ai_cargo.hpp.sq b/src/ai/api/ai_cargo.hpp.sq index 19154dc3f..6426cfb39 100644 --- a/src/ai/api/ai_cargo.hpp.sq +++ b/src/ai/api/ai_cargo.hpp.sq @@ -28,6 +28,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICargo *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargo", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICargo"; } + void SQAICargo_Register(Squirrel *engine) { DefSQClass SQAICargo("AICargo"); diff --git a/src/ai/api/ai_cargolist.hpp b/src/ai/api/ai_cargolist.hpp index 0efd72ae2..01d2ec605 100644 --- a/src/ai/api/ai_cargolist.hpp +++ b/src/ai/api/ai_cargolist.hpp @@ -20,8 +20,6 @@ */ class AICargoList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICargoList"; } AICargoList(); }; @@ -33,9 +31,6 @@ public: */ class AICargoList_IndustryAccepting : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICargoList_IndustryAccepting"; } - /** * @param industry_id The industry to get the list of cargos it accepts from. */ @@ -48,9 +43,6 @@ public: */ class AICargoList_IndustryProducing : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICargoList_IndustryProducing"; } - /** * @param industry_id The industry to get the list of cargos it produces from. */ @@ -63,9 +55,6 @@ public: */ class AICargoList_StationAccepting : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICargoList_StationAccepting"; } - /** * @param station_id The station to get the list of cargos it accepts from. */ diff --git a/src/ai/api/ai_cargolist.hpp.sq b/src/ai/api/ai_cargolist.hpp.sq index 2ba0154a4..28b0cabfe 100644 --- a/src/ai/api/ai_cargolist.hpp.sq +++ b/src/ai/api/ai_cargolist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICargoList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargoList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICargoList"; } + void SQAICargoList_Register(Squirrel *engine) { DefSQClass SQAICargoList("AICargoList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICargoList_IndustryAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargoList_IndustryAccepting", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICargoList_IndustryAccepting"; } + void SQAICargoList_IndustryAccepting_Register(Squirrel *engine) { DefSQClass SQAICargoList_IndustryAccepting("AICargoList_IndustryAccepting"); @@ -56,6 +60,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICargoList_IndustryProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargoList_IndustryProducing", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICargoList_IndustryProducing"; } + void SQAICargoList_IndustryProducing_Register(Squirrel *engine) { DefSQClass SQAICargoList_IndustryProducing("AICargoList_IndustryProducing"); @@ -74,6 +80,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICargoList_StationAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargoList_StationAccepting", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICargoList_StationAccepting"; } + void SQAICargoList_StationAccepting_Register(Squirrel *engine) { DefSQClass SQAICargoList_StationAccepting("AICargoList_StationAccepting"); diff --git a/src/ai/api/ai_company.hpp b/src/ai/api/ai_company.hpp index f7e329531..4980f0ebc 100644 --- a/src/ai/api/ai_company.hpp +++ b/src/ai/api/ai_company.hpp @@ -19,9 +19,6 @@ */ class AICompany : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AICompany"; } - /** The range of possible quarters to get company information of. */ enum Quarter { CURRENT_QUARTER = 0, ///< The current quarter. diff --git a/src/ai/api/ai_company.hpp.sq b/src/ai/api/ai_company.hpp.sq index f2dae40b7..078f578e2 100644 --- a/src/ai/api/ai_company.hpp.sq +++ b/src/ai/api/ai_company.hpp.sq @@ -28,6 +28,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AICompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICompany", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AICompany"; } + void SQAICompany_Register(Squirrel *engine) { DefSQClass SQAICompany("AICompany"); diff --git a/src/ai/api/ai_controller.hpp b/src/ai/api/ai_controller.hpp index ce74d39c9..0df721109 100644 --- a/src/ai/api/ai_controller.hpp +++ b/src/ai/api/ai_controller.hpp @@ -24,9 +24,6 @@ class AIController { friend class AIInstance; public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIController"; } - /** * Initializer of the AIController. */ diff --git a/src/ai/api/ai_controller.hpp.sq b/src/ai/api/ai_controller.hpp.sq index fdfb47788..8a0e70ccd 100644 --- a/src/ai/api/ai_controller.hpp.sq +++ b/src/ai/api/ai_controller.hpp.sq @@ -9,6 +9,8 @@ #include "ai_controller.hpp" +template <> const char *GetClassName() { return "AIController"; } + void SQAIController_Register(Squirrel *engine) { DefSQClass SQAIController("AIController"); diff --git a/src/ai/api/ai_date.hpp b/src/ai/api/ai_date.hpp index 3bb22f993..3927845b3 100644 --- a/src/ai/api/ai_date.hpp +++ b/src/ai/api/ai_date.hpp @@ -26,9 +26,6 @@ */ class AIDate : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIDate"; } - /** * Get the current date. * This is the number of days since epoch under the assumption that diff --git a/src/ai/api/ai_date.hpp.sq b/src/ai/api/ai_date.hpp.sq index 76e9775b0..6a5a01222 100644 --- a/src/ai/api/ai_date.hpp.sq +++ b/src/ai/api/ai_date.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIDate *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIDate", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIDate"; } + void SQAIDate_Register(Squirrel *engine) { DefSQClass SQAIDate("AIDate"); diff --git a/src/ai/api/ai_depotlist.hpp b/src/ai/api/ai_depotlist.hpp index db180a35c..a84e698ea 100644 --- a/src/ai/api/ai_depotlist.hpp +++ b/src/ai/api/ai_depotlist.hpp @@ -21,9 +21,6 @@ */ class AIDepotList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIDepotList"; } - /** * @param transport_type The type of transport to make a list of depots for. */ diff --git a/src/ai/api/ai_depotlist.hpp.sq b/src/ai/api/ai_depotlist.hpp.sq index 0ea52b077..440aa106a 100644 --- a/src/ai/api/ai_depotlist.hpp.sq +++ b/src/ai/api/ai_depotlist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIDepotList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIDepotList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIDepotList"; } + void SQAIDepotList_Register(Squirrel *engine) { DefSQClass SQAIDepotList("AIDepotList"); diff --git a/src/ai/api/ai_engine.hpp b/src/ai/api/ai_engine.hpp index 337b80485..f44268668 100644 --- a/src/ai/api/ai_engine.hpp +++ b/src/ai/api/ai_engine.hpp @@ -21,9 +21,6 @@ */ class AIEngine : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEngine"; } - /** * Checks whether the given engine type is valid. An engine is valid if you * have at least one vehicle of this engine or it's currently buildable. diff --git a/src/ai/api/ai_engine.hpp.sq b/src/ai/api/ai_engine.hpp.sq index 58a9744aa..205e10309 100644 --- a/src/ai/api/ai_engine.hpp.sq +++ b/src/ai/api/ai_engine.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEngine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEngine", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEngine"; } + void SQAIEngine_Register(Squirrel *engine) { DefSQClass SQAIEngine("AIEngine"); diff --git a/src/ai/api/ai_enginelist.hpp b/src/ai/api/ai_enginelist.hpp index ff9a72729..d5e67ddd8 100644 --- a/src/ai/api/ai_enginelist.hpp +++ b/src/ai/api/ai_enginelist.hpp @@ -21,9 +21,6 @@ */ class AIEngineList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEngineList"; } - /** * @param vehicle_type The type of vehicle to make a list of engines for. */ diff --git a/src/ai/api/ai_enginelist.hpp.sq b/src/ai/api/ai_enginelist.hpp.sq index f91a590fd..053c02f90 100644 --- a/src/ai/api/ai_enginelist.hpp.sq +++ b/src/ai/api/ai_enginelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEngineList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEngineList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEngineList"; } + void SQAIEngineList_Register(Squirrel *engine) { DefSQClass SQAIEngineList("AIEngineList"); diff --git a/src/ai/api/ai_error.hpp b/src/ai/api/ai_error.hpp index 44e4573d4..77f0a5ea4 100644 --- a/src/ai/api/ai_error.hpp +++ b/src/ai/api/ai_error.hpp @@ -43,9 +43,6 @@ */ class AIError : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIError"; } - /** * All categories errors can be divided in. */ diff --git a/src/ai/api/ai_error.hpp.sq b/src/ai/api/ai_error.hpp.sq index 5101d77f3..bd6275988 100644 --- a/src/ai/api/ai_error.hpp.sq +++ b/src/ai/api/ai_error.hpp.sq @@ -26,6 +26,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIError *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIError", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIError"; } + void SQAIError_Register(Squirrel *engine) { DefSQClass SQAIError("AIError"); diff --git a/src/ai/api/ai_event.hpp b/src/ai/api/ai_event.hpp index 4b3b2cf94..cbd5134f8 100644 --- a/src/ai/api/ai_event.hpp +++ b/src/ai/api/ai_event.hpp @@ -21,9 +21,6 @@ */ class AIEvent : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEvent"; } - /** * The type of event. Needed to lookup the detailed class. */ @@ -80,12 +77,6 @@ protected: */ class AIEventController : public AIObject { public: - /** - * The name of the class, needed by several sub-processes. - */ - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventController"; } - /** * Check if there is an event waiting. * @return true if there is an event on the stack. diff --git a/src/ai/api/ai_event.hpp.sq b/src/ai/api/ai_event.hpp.sq index b97de98ed..d1147c58c 100644 --- a/src/ai/api/ai_event.hpp.sq +++ b/src/ai/api/ai_event.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEvent *res) { if (res == NULL) { sq_pushnull(vm); return 1; } Squirrel::CreateClassInstanceVM(vm, "AIEvent", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEvent"; } + void SQAIEvent_Register(Squirrel *engine) { DefSQClass SQAIEvent("AIEvent"); @@ -68,6 +70,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventController *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventController", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventController"; } + void SQAIEventController_Register(Squirrel *engine) { DefSQClass SQAIEventController("AIEventController"); diff --git a/src/ai/api/ai_event_types.hpp b/src/ai/api/ai_event_types.hpp index 0bebb53b7..92d7e3cfe 100644 --- a/src/ai/api/ai_event_types.hpp +++ b/src/ai/api/ai_event_types.hpp @@ -21,9 +21,6 @@ */ class AIEventVehicleCrashed : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventVehicleCrashed"; } - /** * The reasons for vehicle crashes */ @@ -84,9 +81,6 @@ private: */ class AIEventSubsidyOffer : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventSubsidyOffer"; } - /** * @param subsidy_id The index of this subsidy in the _subsidies array. */ @@ -117,9 +111,6 @@ private: */ class AIEventSubsidyOfferExpired : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventSubsidyOfferExpired"; } - /** * @param subsidy_id The index of this subsidy in the _subsidies array. */ @@ -150,9 +141,6 @@ private: */ class AIEventSubsidyAwarded : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventSubsidyAwarded"; } - /** * @param subsidy_id The index of this subsidy in the _subsidies array. */ @@ -183,9 +171,6 @@ private: */ class AIEventSubsidyExpired : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventSubsidyExpired"; } - /** * @param subsidy_id The index of this subsidy in the _subsidies array. */ @@ -218,9 +203,6 @@ private: */ class AIEventEnginePreview : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventEnginePreview"; } - /** * @param engine The engine offered to test. */ @@ -309,9 +291,6 @@ private: */ class AIEventCompanyNew : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventCompanyNew"; } - /** * @param owner The new company. */ @@ -343,9 +322,6 @@ private: */ class AIEventCompanyInTrouble : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventCompanyInTrouble"; } - /** * @param owner The company that is in trouble. */ @@ -376,9 +352,6 @@ private: */ class AIEventCompanyAskMerger : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventCompanyAskMerger"; } - /** * @param owner The company that can be bough. * @param value The value/costs of buying the company. @@ -426,9 +399,6 @@ private: */ class AIEventCompanyMerger : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventCompanyMerger"; } - /** * @param old_owner The company bought off. * @param new_owner The company that bougth owner. @@ -471,9 +441,6 @@ private: */ class AIEventCompanyBankrupt : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventCompanyBankrupt"; } - /** * @param owner The company that has gone bankrupt. */ @@ -504,9 +471,6 @@ private: */ class AIEventVehicleLost : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventVehicleLost"; } - /** * @param vehicle_id The vehicle that is lost. */ @@ -537,9 +501,6 @@ private: */ class AIEventVehicleWaitingInDepot : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventVehicleWaitingInDepot"; } - /** * @param vehicle_id The vehicle that is waiting in a depot. */ @@ -570,9 +531,6 @@ private: */ class AIEventVehicleUnprofitable : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventVehicleUnprofitable"; } - /** * @param vehicle_id The vehicle that was unprofitable. */ @@ -603,9 +561,6 @@ private: */ class AIEventIndustryOpen : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventIndustryOpen"; } - /** * @param industry_id The new industry. */ @@ -636,9 +591,6 @@ private: */ class AIEventIndustryClose : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventIndustryClose"; } - /** * @param industry_id The new industry. */ @@ -669,9 +621,6 @@ private: */ class AIEventEngineAvailable : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventEngineAvailable"; } - /** * @param engine The engine that is available. */ @@ -702,9 +651,6 @@ private: */ class AIEventStationFirstVehicle : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventStationFirstVehicle"; } - /** * @param station The station visited for the first time. * @param vehicle The vehicle visiting the station. @@ -744,9 +690,6 @@ private: */ class AIEventDisasterZeppelinerCrashed : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventDisasterZeppelinerCrashed"; } - /** * @param station The station containing the affected airport */ @@ -777,9 +720,6 @@ private: */ class AIEventDisasterZeppelinerCleared : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventDisasterZeppelinerCleared"; } - /** * @param station The station containing the affected airport */ @@ -810,9 +750,6 @@ private: */ class AIEventTownFounded : public AIEvent { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIEventTownFounded"; } - /** * @param town The town that was created. */ diff --git a/src/ai/api/ai_event_types.hpp.sq b/src/ai/api/ai_event_types.hpp.sq index 771a0778e..a6ae6f6c8 100644 --- a/src/ai/api/ai_event_types.hpp.sq +++ b/src/ai/api/ai_event_types.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventVehicleCrashed *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventVehicleCrashed", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventVehicleCrashed"; } + void SQAIEventVehicleCrashed_Register(Squirrel *engine) { DefSQClass SQAIEventVehicleCrashed("AIEventVehicleCrashed"); @@ -54,6 +56,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventSubsidyOffer *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventSubsidyOffer", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventSubsidyOffer"; } + void SQAIEventSubsidyOffer_Register(Squirrel *engine) { DefSQClass SQAIEventSubsidyOffer("AIEventSubsidyOffer"); @@ -75,6 +79,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventSubsidyOfferExpired *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventSubsidyOfferExpired", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventSubsidyOfferExpired"; } + void SQAIEventSubsidyOfferExpired_Register(Squirrel *engine) { DefSQClass SQAIEventSubsidyOfferExpired("AIEventSubsidyOfferExpired"); @@ -96,6 +102,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventSubsidyAwarded *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventSubsidyAwarded", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventSubsidyAwarded"; } + void SQAIEventSubsidyAwarded_Register(Squirrel *engine) { DefSQClass SQAIEventSubsidyAwarded("AIEventSubsidyAwarded"); @@ -117,6 +125,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventSubsidyExpired *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventSubsidyExpired", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventSubsidyExpired"; } + void SQAIEventSubsidyExpired_Register(Squirrel *engine) { DefSQClass SQAIEventSubsidyExpired("AIEventSubsidyExpired"); @@ -138,6 +148,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventEnginePreview *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventEnginePreview", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventEnginePreview"; } + void SQAIEventEnginePreview_Register(Squirrel *engine) { DefSQClass SQAIEventEnginePreview("AIEventEnginePreview"); @@ -166,6 +178,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventCompanyNew *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventCompanyNew", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventCompanyNew"; } + void SQAIEventCompanyNew_Register(Squirrel *engine) { DefSQClass SQAIEventCompanyNew("AIEventCompanyNew"); @@ -187,6 +201,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventCompanyInTrouble *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventCompanyInTrouble", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventCompanyInTrouble"; } + void SQAIEventCompanyInTrouble_Register(Squirrel *engine) { DefSQClass SQAIEventCompanyInTrouble("AIEventCompanyInTrouble"); @@ -208,6 +224,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventCompanyAskMerger *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventCompanyAskMerger", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventCompanyAskMerger"; } + void SQAIEventCompanyAskMerger_Register(Squirrel *engine) { DefSQClass SQAIEventCompanyAskMerger("AIEventCompanyAskMerger"); @@ -231,6 +249,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventCompanyMerger *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventCompanyMerger", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventCompanyMerger"; } + void SQAIEventCompanyMerger_Register(Squirrel *engine) { DefSQClass SQAIEventCompanyMerger("AIEventCompanyMerger"); @@ -253,6 +273,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventCompanyBankrupt *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventCompanyBankrupt", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventCompanyBankrupt"; } + void SQAIEventCompanyBankrupt_Register(Squirrel *engine) { DefSQClass SQAIEventCompanyBankrupt("AIEventCompanyBankrupt"); @@ -274,6 +296,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventVehicleLost *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventVehicleLost", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventVehicleLost"; } + void SQAIEventVehicleLost_Register(Squirrel *engine) { DefSQClass SQAIEventVehicleLost("AIEventVehicleLost"); @@ -295,6 +319,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventVehicleWaitingInDepot *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventVehicleWaitingInDepot", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventVehicleWaitingInDepot"; } + void SQAIEventVehicleWaitingInDepot_Register(Squirrel *engine) { DefSQClass SQAIEventVehicleWaitingInDepot("AIEventVehicleWaitingInDepot"); @@ -316,6 +342,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventVehicleUnprofitable *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventVehicleUnprofitable", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventVehicleUnprofitable"; } + void SQAIEventVehicleUnprofitable_Register(Squirrel *engine) { DefSQClass SQAIEventVehicleUnprofitable("AIEventVehicleUnprofitable"); @@ -337,6 +365,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventIndustryOpen *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventIndustryOpen", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventIndustryOpen"; } + void SQAIEventIndustryOpen_Register(Squirrel *engine) { DefSQClass SQAIEventIndustryOpen("AIEventIndustryOpen"); @@ -358,6 +388,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventIndustryClose *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventIndustryClose", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventIndustryClose"; } + void SQAIEventIndustryClose_Register(Squirrel *engine) { DefSQClass SQAIEventIndustryClose("AIEventIndustryClose"); @@ -379,6 +411,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventEngineAvailable *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventEngineAvailable", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventEngineAvailable"; } + void SQAIEventEngineAvailable_Register(Squirrel *engine) { DefSQClass SQAIEventEngineAvailable("AIEventEngineAvailable"); @@ -400,6 +434,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventStationFirstVehicle *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventStationFirstVehicle", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventStationFirstVehicle"; } + void SQAIEventStationFirstVehicle_Register(Squirrel *engine) { DefSQClass SQAIEventStationFirstVehicle("AIEventStationFirstVehicle"); @@ -422,6 +458,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventDisasterZeppelinerCrashed *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventDisasterZeppelinerCrashed", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventDisasterZeppelinerCrashed"; } + void SQAIEventDisasterZeppelinerCrashed_Register(Squirrel *engine) { DefSQClass SQAIEventDisasterZeppelinerCrashed("AIEventDisasterZeppelinerCrashed"); @@ -443,6 +481,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventDisasterZeppelinerCleared *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventDisasterZeppelinerCleared", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventDisasterZeppelinerCleared"; } + void SQAIEventDisasterZeppelinerCleared_Register(Squirrel *engine) { DefSQClass SQAIEventDisasterZeppelinerCleared("AIEventDisasterZeppelinerCleared"); @@ -464,6 +504,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIEventTownFounded *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventTownFounded", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIEventTownFounded"; } + void SQAIEventTownFounded_Register(Squirrel *engine) { DefSQClass SQAIEventTownFounded("AIEventTownFounded"); diff --git a/src/ai/api/ai_execmode.hpp b/src/ai/api/ai_execmode.hpp index 569cc6526..43765f177 100644 --- a/src/ai/api/ai_execmode.hpp +++ b/src/ai/api/ai_execmode.hpp @@ -22,10 +22,6 @@ * In Execute mode all commands you do are executed for real. */ class AIExecMode : public AIObject { -public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIExecMode"; } - private: AIModeProc *last_mode; ///< The previous mode we were in. AIObject *last_instance; ///< The previous instace of the mode. diff --git a/src/ai/api/ai_execmode.hpp.sq b/src/ai/api/ai_execmode.hpp.sq index 1d9d7fbee..a00d0eec6 100644 --- a/src/ai/api/ai_execmode.hpp.sq +++ b/src/ai/api/ai_execmode.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIExecMode *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIExecMode", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIExecMode"; } + void SQAIExecMode_Register(Squirrel *engine) { DefSQClass SQAIExecMode("AIExecMode"); diff --git a/src/ai/api/ai_gamesettings.hpp b/src/ai/api/ai_gamesettings.hpp index a615a615f..947dc8f99 100644 --- a/src/ai/api/ai_gamesettings.hpp +++ b/src/ai/api/ai_gamesettings.hpp @@ -36,9 +36,6 @@ */ class AIGameSettings : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIGameSettings"; } - /** * Is the given game setting a valid setting for this instance of OpenTTD? * @param setting The setting to check for existence. diff --git a/src/ai/api/ai_gamesettings.hpp.sq b/src/ai/api/ai_gamesettings.hpp.sq index 158f205f6..299ba84bb 100644 --- a/src/ai/api/ai_gamesettings.hpp.sq +++ b/src/ai/api/ai_gamesettings.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIGameSettings *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIGameSettings", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIGameSettings"; } + void SQAIGameSettings_Register(Squirrel *engine) { DefSQClass SQAIGameSettings("AIGameSettings"); diff --git a/src/ai/api/ai_group.hpp b/src/ai/api/ai_group.hpp index bff9d8dd4..2e025e013 100644 --- a/src/ai/api/ai_group.hpp +++ b/src/ai/api/ai_group.hpp @@ -19,9 +19,6 @@ */ class AIGroup : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIGroup"; } - /** * The group IDs of some special groups. */ diff --git a/src/ai/api/ai_group.hpp.sq b/src/ai/api/ai_group.hpp.sq index 1eb7d1456..6fe359079 100644 --- a/src/ai/api/ai_group.hpp.sq +++ b/src/ai/api/ai_group.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIGroup *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIGroup", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIGroup"; } + void SQAIGroup_Register(Squirrel *engine) { DefSQClass SQAIGroup("AIGroup"); diff --git a/src/ai/api/ai_grouplist.hpp b/src/ai/api/ai_grouplist.hpp index 227d3f8e8..1631a1d1d 100644 --- a/src/ai/api/ai_grouplist.hpp +++ b/src/ai/api/ai_grouplist.hpp @@ -21,8 +21,6 @@ */ class AIGroupList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIGroupList"; } AIGroupList(); }; diff --git a/src/ai/api/ai_grouplist.hpp.sq b/src/ai/api/ai_grouplist.hpp.sq index dea8b5a34..6c9f283af 100644 --- a/src/ai/api/ai_grouplist.hpp.sq +++ b/src/ai/api/ai_grouplist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIGroupList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIGroupList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIGroupList"; } + void SQAIGroupList_Register(Squirrel *engine) { DefSQClass SQAIGroupList("AIGroupList"); diff --git a/src/ai/api/ai_industry.hpp b/src/ai/api/ai_industry.hpp index 85f2a4dee..4ffdf42fc 100644 --- a/src/ai/api/ai_industry.hpp +++ b/src/ai/api/ai_industry.hpp @@ -19,9 +19,6 @@ */ class AIIndustry : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustry"; } - /** Ways for an industry to accept a cargo. */ enum CargoAcceptState { CAS_NOT_ACCEPTED, ///< The CargoID is not accepted by this industry. diff --git a/src/ai/api/ai_industry.hpp.sq b/src/ai/api/ai_industry.hpp.sq index e0ff0ff8c..dc7dcdf4c 100644 --- a/src/ai/api/ai_industry.hpp.sq +++ b/src/ai/api/ai_industry.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustry *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustry", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustry"; } + void SQAIIndustry_Register(Squirrel *engine) { DefSQClass SQAIIndustry("AIIndustry"); diff --git a/src/ai/api/ai_industrylist.hpp b/src/ai/api/ai_industrylist.hpp index b7dd7bc9f..255873b82 100644 --- a/src/ai/api/ai_industrylist.hpp +++ b/src/ai/api/ai_industrylist.hpp @@ -20,8 +20,6 @@ */ class AIIndustryList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustryList"; } AIIndustryList(); }; @@ -31,9 +29,6 @@ public: */ class AIIndustryList_CargoAccepting : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustryList_CargoAccepting"; } - /** * @param cargo_id The cargo this industry should accept. */ @@ -47,9 +42,6 @@ public: */ class AIIndustryList_CargoProducing : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustryList_CargoProducing"; } - /** * @param cargo_id The cargo this industry should produce. */ diff --git a/src/ai/api/ai_industrylist.hpp.sq b/src/ai/api/ai_industrylist.hpp.sq index 00cfdb1ee..825253c1a 100644 --- a/src/ai/api/ai_industrylist.hpp.sq +++ b/src/ai/api/ai_industrylist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustryList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustryList"; } + void SQAIIndustryList_Register(Squirrel *engine) { DefSQClass SQAIIndustryList("AIIndustryList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustryList_CargoAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryList_CargoAccepting", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustryList_CargoAccepting"; } + void SQAIIndustryList_CargoAccepting_Register(Squirrel *engine) { DefSQClass SQAIIndustryList_CargoAccepting("AIIndustryList_CargoAccepting"); @@ -56,6 +60,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustryList_CargoProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryList_CargoProducing", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustryList_CargoProducing"; } + void SQAIIndustryList_CargoProducing_Register(Squirrel *engine) { DefSQClass SQAIIndustryList_CargoProducing("AIIndustryList_CargoProducing"); diff --git a/src/ai/api/ai_industrytype.hpp b/src/ai/api/ai_industrytype.hpp index 11e1fb9fe..523fad8e3 100644 --- a/src/ai/api/ai_industrytype.hpp +++ b/src/ai/api/ai_industrytype.hpp @@ -19,9 +19,6 @@ */ class AIIndustryType : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustryType"; } - /** * Special IndustryTypes. */ diff --git a/src/ai/api/ai_industrytype.hpp.sq b/src/ai/api/ai_industrytype.hpp.sq index 938477145..a5969b325 100644 --- a/src/ai/api/ai_industrytype.hpp.sq +++ b/src/ai/api/ai_industrytype.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustryType *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryType", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustryType"; } + void SQAIIndustryType_Register(Squirrel *engine) { DefSQClass SQAIIndustryType("AIIndustryType"); diff --git a/src/ai/api/ai_industrytypelist.hpp b/src/ai/api/ai_industrytypelist.hpp index b29c4b011..90991096a 100644 --- a/src/ai/api/ai_industrytypelist.hpp +++ b/src/ai/api/ai_industrytypelist.hpp @@ -20,8 +20,6 @@ */ class AIIndustryTypeList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIIndustryTypeList"; } AIIndustryTypeList(); }; diff --git a/src/ai/api/ai_industrytypelist.hpp.sq b/src/ai/api/ai_industrytypelist.hpp.sq index 38dabb7d7..43869ab94 100644 --- a/src/ai/api/ai_industrytypelist.hpp.sq +++ b/src/ai/api/ai_industrytypelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIIndustryTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryTypeList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIIndustryTypeList"; } + void SQAIIndustryTypeList_Register(Squirrel *engine) { DefSQClass SQAIIndustryTypeList("AIIndustryTypeList"); diff --git a/src/ai/api/ai_list.hpp b/src/ai/api/ai_list.hpp index 05f7aeb4c..9087f26c5 100644 --- a/src/ai/api/ai_list.hpp +++ b/src/ai/api/ai_list.hpp @@ -24,9 +24,6 @@ class AIListSorter; */ class AIList : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIList"; } - /** Type of sorter */ enum SorterType { SORT_BY_VALUE, ///< Sort the list based on the value of the item. diff --git a/src/ai/api/ai_list.hpp.sq b/src/ai/api/ai_list.hpp.sq index ca903b693..fdff72c31 100644 --- a/src/ai/api/ai_list.hpp.sq +++ b/src/ai/api/ai_list.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIList"; } + void SQAIList_Register(Squirrel *engine) { DefSQClass SQAIList("AIList"); diff --git a/src/ai/api/ai_log.hpp b/src/ai/api/ai_log.hpp index c14416644..00ada4e3f 100644 --- a/src/ai/api/ai_log.hpp +++ b/src/ai/api/ai_log.hpp @@ -23,9 +23,6 @@ class AILog : public AIObject { friend class AIController; public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AILog"; } - #ifndef EXPORT_SKIP /** * Log levels; The value is also feed to DEBUG() lvl. diff --git a/src/ai/api/ai_log.hpp.sq b/src/ai/api/ai_log.hpp.sq index b943a4ce5..36842ff3a 100644 --- a/src/ai/api/ai_log.hpp.sq +++ b/src/ai/api/ai_log.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AILog *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AILog", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AILog"; } + void SQAILog_Register(Squirrel *engine) { DefSQClass SQAILog("AILog"); diff --git a/src/ai/api/ai_map.hpp b/src/ai/api/ai_map.hpp index 316a3590e..15ff5c337 100644 --- a/src/ai/api/ai_map.hpp +++ b/src/ai/api/ai_map.hpp @@ -22,9 +22,6 @@ class AIMap : public AIObject { public: static const int TILE_INVALID = (int)INVALID_TILE; ///< Invalid TileIndex. - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIMap"; } - /** * Checks whether the given tile is valid. * @param tile The tile to check. diff --git a/src/ai/api/ai_map.hpp.sq b/src/ai/api/ai_map.hpp.sq index 24e96470a..0c4c0dfcb 100644 --- a/src/ai/api/ai_map.hpp.sq +++ b/src/ai/api/ai_map.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIMap *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIMap", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIMap"; } + void SQAIMap_Register(Squirrel *engine) { DefSQClass SQAIMap("AIMap"); diff --git a/src/ai/api/ai_marine.hpp b/src/ai/api/ai_marine.hpp index 966ab9e1f..1eb691fe3 100644 --- a/src/ai/api/ai_marine.hpp +++ b/src/ai/api/ai_marine.hpp @@ -19,9 +19,6 @@ */ class AIMarine : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIMarine"; } - /** * All marine related error messages. */ diff --git a/src/ai/api/ai_marine.hpp.sq b/src/ai/api/ai_marine.hpp.sq index 40e153461..e72771d52 100644 --- a/src/ai/api/ai_marine.hpp.sq +++ b/src/ai/api/ai_marine.hpp.sq @@ -26,6 +26,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIMarine *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIMarine", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIMarine"; } + void SQAIMarine_Register(Squirrel *engine) { DefSQClass SQAIMarine("AIMarine"); diff --git a/src/ai/api/ai_order.hpp b/src/ai/api/ai_order.hpp index cc2e0cc73..470b6faaf 100644 --- a/src/ai/api/ai_order.hpp +++ b/src/ai/api/ai_order.hpp @@ -19,9 +19,6 @@ */ class AIOrder : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIOrder"; } - /** * All order related error messages. */ diff --git a/src/ai/api/ai_order.hpp.sq b/src/ai/api/ai_order.hpp.sq index 9a289bdf0..1296b3c0a 100644 --- a/src/ai/api/ai_order.hpp.sq +++ b/src/ai/api/ai_order.hpp.sq @@ -34,6 +34,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIOrder *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIOrder", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIOrder"; } + void SQAIOrder_Register(Squirrel *engine) { DefSQClass SQAIOrder("AIOrder"); diff --git a/src/ai/api/ai_rail.hpp b/src/ai/api/ai_rail.hpp index 9bb759ea7..0a9f70c5b 100644 --- a/src/ai/api/ai_rail.hpp +++ b/src/ai/api/ai_rail.hpp @@ -19,9 +19,6 @@ */ class AIRail : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIRail"; } - /** * All rail related error messages. */ diff --git a/src/ai/api/ai_rail.hpp.sq b/src/ai/api/ai_rail.hpp.sq index 7be4b7b75..0adceeac6 100644 --- a/src/ai/api/ai_rail.hpp.sq +++ b/src/ai/api/ai_rail.hpp.sq @@ -32,6 +32,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIRail *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIRail", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIRail"; } + void SQAIRail_Register(Squirrel *engine) { DefSQClass SQAIRail("AIRail"); diff --git a/src/ai/api/ai_railtypelist.hpp b/src/ai/api/ai_railtypelist.hpp index dcf5bbf5b..8162b80f5 100644 --- a/src/ai/api/ai_railtypelist.hpp +++ b/src/ai/api/ai_railtypelist.hpp @@ -20,8 +20,6 @@ */ class AIRailTypeList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIRailTypeList"; } AIRailTypeList(); }; diff --git a/src/ai/api/ai_railtypelist.hpp.sq b/src/ai/api/ai_railtypelist.hpp.sq index 5ced03aea..44720a74e 100644 --- a/src/ai/api/ai_railtypelist.hpp.sq +++ b/src/ai/api/ai_railtypelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIRailTypeList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIRailTypeList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIRailTypeList"; } + void SQAIRailTypeList_Register(Squirrel *engine) { DefSQClass SQAIRailTypeList("AIRailTypeList"); diff --git a/src/ai/api/ai_road.hpp b/src/ai/api/ai_road.hpp index 90129f7c4..32095799f 100644 --- a/src/ai/api/ai_road.hpp +++ b/src/ai/api/ai_road.hpp @@ -19,9 +19,6 @@ */ class AIRoad : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIRoad"; } - /** * All road related error messages. */ diff --git a/src/ai/api/ai_road.hpp.sq b/src/ai/api/ai_road.hpp.sq index 05d4e0bee..4507e9edc 100644 --- a/src/ai/api/ai_road.hpp.sq +++ b/src/ai/api/ai_road.hpp.sq @@ -30,6 +30,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIRoad *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIRoad", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIRoad"; } + void SQAIRoad_Register(Squirrel *engine) { DefSQClass SQAIRoad("AIRoad"); diff --git a/src/ai/api/ai_sign.hpp b/src/ai/api/ai_sign.hpp index c2816d796..afbcf0d77 100644 --- a/src/ai/api/ai_sign.hpp +++ b/src/ai/api/ai_sign.hpp @@ -19,9 +19,6 @@ */ class AISign : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AISign"; } - /** * All sign related error messages. */ diff --git a/src/ai/api/ai_sign.hpp.sq b/src/ai/api/ai_sign.hpp.sq index 35df2636e..b1a27c1c3 100644 --- a/src/ai/api/ai_sign.hpp.sq +++ b/src/ai/api/ai_sign.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AISign *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AISign", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AISign"; } + void SQAISign_Register(Squirrel *engine) { DefSQClass SQAISign("AISign"); diff --git a/src/ai/api/ai_signlist.hpp b/src/ai/api/ai_signlist.hpp index 088d79052..d96e8c658 100644 --- a/src/ai/api/ai_signlist.hpp +++ b/src/ai/api/ai_signlist.hpp @@ -20,8 +20,6 @@ */ class AISignList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AISignList"; } AISignList(); }; diff --git a/src/ai/api/ai_signlist.hpp.sq b/src/ai/api/ai_signlist.hpp.sq index 9729ee7fa..083eba561 100644 --- a/src/ai/api/ai_signlist.hpp.sq +++ b/src/ai/api/ai_signlist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AISignList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AISignList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AISignList"; } + void SQAISignList_Register(Squirrel *engine) { DefSQClass SQAISignList("AISignList"); diff --git a/src/ai/api/ai_station.hpp b/src/ai/api/ai_station.hpp index 0faaaf147..66b1690bf 100644 --- a/src/ai/api/ai_station.hpp +++ b/src/ai/api/ai_station.hpp @@ -20,9 +20,6 @@ */ class AIStation : public AIBaseStation { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIStation"; } - /** * All station related error messages. */ diff --git a/src/ai/api/ai_station.hpp.sq b/src/ai/api/ai_station.hpp.sq index bca735132..6d210b271 100644 --- a/src/ai/api/ai_station.hpp.sq +++ b/src/ai/api/ai_station.hpp.sq @@ -26,6 +26,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIStation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIStation", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIStation"; } + void SQAIStation_Register(Squirrel *engine) { DefSQClass SQAIStation("AIStation"); diff --git a/src/ai/api/ai_stationlist.hpp b/src/ai/api/ai_stationlist.hpp index 747931598..b066523ab 100644 --- a/src/ai/api/ai_stationlist.hpp +++ b/src/ai/api/ai_stationlist.hpp @@ -21,9 +21,6 @@ */ class AIStationList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIStationList"; } - /** * @param station_type The type of station to make a list of stations for. */ @@ -36,9 +33,6 @@ public: */ class AIStationList_Vehicle : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIStationList_Vehicle"; } - /** * @param vehicle_id The vehicle to get the list of stations he has in its orders from. */ diff --git a/src/ai/api/ai_stationlist.hpp.sq b/src/ai/api/ai_stationlist.hpp.sq index 104797ec1..b80addbdf 100644 --- a/src/ai/api/ai_stationlist.hpp.sq +++ b/src/ai/api/ai_stationlist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIStationList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIStationList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIStationList"; } + void SQAIStationList_Register(Squirrel *engine) { DefSQClass SQAIStationList("AIStationList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIStationList_Vehicle *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIStationList_Vehicle", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIStationList_Vehicle"; } + void SQAIStationList_Vehicle_Register(Squirrel *engine) { DefSQClass SQAIStationList_Vehicle("AIStationList_Vehicle"); diff --git a/src/ai/api/ai_subsidy.hpp b/src/ai/api/ai_subsidy.hpp index b4079e59f..f9f0cf140 100644 --- a/src/ai/api/ai_subsidy.hpp +++ b/src/ai/api/ai_subsidy.hpp @@ -19,9 +19,6 @@ */ class AISubsidy : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AISubsidy"; } - /** * Enumeration for source and destination of a subsidy. * @note The list of values may grow in future. diff --git a/src/ai/api/ai_subsidy.hpp.sq b/src/ai/api/ai_subsidy.hpp.sq index 3b5f00910..fa99166a3 100644 --- a/src/ai/api/ai_subsidy.hpp.sq +++ b/src/ai/api/ai_subsidy.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AISubsidy *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AISubsidy", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AISubsidy"; } + void SQAISubsidy_Register(Squirrel *engine) { DefSQClass SQAISubsidy("AISubsidy"); diff --git a/src/ai/api/ai_subsidylist.hpp b/src/ai/api/ai_subsidylist.hpp index cfa0ebcf5..786f1377f 100644 --- a/src/ai/api/ai_subsidylist.hpp +++ b/src/ai/api/ai_subsidylist.hpp @@ -20,8 +20,6 @@ */ class AISubsidyList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AISubsidyList"; } AISubsidyList(); }; diff --git a/src/ai/api/ai_subsidylist.hpp.sq b/src/ai/api/ai_subsidylist.hpp.sq index d36db43d6..7996d9751 100644 --- a/src/ai/api/ai_subsidylist.hpp.sq +++ b/src/ai/api/ai_subsidylist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AISubsidyList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AISubsidyList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AISubsidyList"; } + void SQAISubsidyList_Register(Squirrel *engine) { DefSQClass SQAISubsidyList("AISubsidyList"); diff --git a/src/ai/api/ai_testmode.hpp b/src/ai/api/ai_testmode.hpp index c82ce7891..16964ef28 100644 --- a/src/ai/api/ai_testmode.hpp +++ b/src/ai/api/ai_testmode.hpp @@ -24,10 +24,6 @@ * the cost would be. */ class AITestMode : public AIObject { -public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITestMode"; } - private: AIModeProc *last_mode; ///< The previous mode we were in. AIObject *last_instance; ///< The previous instace of the mode. diff --git a/src/ai/api/ai_testmode.hpp.sq b/src/ai/api/ai_testmode.hpp.sq index b31b09a92..87f9db643 100644 --- a/src/ai/api/ai_testmode.hpp.sq +++ b/src/ai/api/ai_testmode.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITestMode *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITestMode", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITestMode"; } + void SQAITestMode_Register(Squirrel *engine) { DefSQClass SQAITestMode("AITestMode"); diff --git a/src/ai/api/ai_tile.hpp b/src/ai/api/ai_tile.hpp index 037a04d62..f9f5ba367 100644 --- a/src/ai/api/ai_tile.hpp +++ b/src/ai/api/ai_tile.hpp @@ -20,9 +20,6 @@ */ class AITile : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITile"; } - /** * Error messages related to modifying tiles. */ diff --git a/src/ai/api/ai_tile.hpp.sq b/src/ai/api/ai_tile.hpp.sq index 8c7ba0b86..c08fcbdd8 100644 --- a/src/ai/api/ai_tile.hpp.sq +++ b/src/ai/api/ai_tile.hpp.sq @@ -32,6 +32,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITile", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITile"; } + void SQAITile_Register(Squirrel *engine) { DefSQClass SQAITile("AITile"); diff --git a/src/ai/api/ai_tilelist.hpp b/src/ai/api/ai_tilelist.hpp index ddfcd8eb4..803429a60 100644 --- a/src/ai/api/ai_tilelist.hpp +++ b/src/ai/api/ai_tilelist.hpp @@ -21,9 +21,6 @@ */ class AITileList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITileList"; } - /** * Adds the rectangle between tile_from and tile_to to the to-be-evaluated tiles. * @param tile_from One corner of the tiles to add. @@ -64,9 +61,6 @@ public: */ class AITileList_IndustryAccepting : public AITileList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITileList_IndustryAccepting"; } - /** * @param industry_id The industry to create the AITileList around. * @param radius The radius of the station you will be using. @@ -83,9 +77,6 @@ public: */ class AITileList_IndustryProducing : public AITileList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITileList_IndustryProducing"; } - /** * @param industry_id The industry to create the AITileList around. * @param radius The radius of the station you will be using. @@ -102,9 +93,6 @@ public: */ class AITileList_StationType : public AITileList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITileList_StationType"; } - /** * @param station_id The station to create the AITileList for. * @param station_type The StationType to create the AIList for. diff --git a/src/ai/api/ai_tilelist.hpp.sq b/src/ai/api/ai_tilelist.hpp.sq index 22739a2db..1a44c8e42 100644 --- a/src/ai/api/ai_tilelist.hpp.sq +++ b/src/ai/api/ai_tilelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITileList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITileList"; } + void SQAITileList_Register(Squirrel *engine) { DefSQClass SQAITileList("AITileList"); @@ -43,6 +45,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITileList_IndustryAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileList_IndustryAccepting", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITileList_IndustryAccepting"; } + void SQAITileList_IndustryAccepting_Register(Squirrel *engine) { DefSQClass SQAITileList_IndustryAccepting("AITileList_IndustryAccepting"); @@ -61,6 +65,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITileList_IndustryProducing *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileList_IndustryProducing", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITileList_IndustryProducing"; } + void SQAITileList_IndustryProducing_Register(Squirrel *engine) { DefSQClass SQAITileList_IndustryProducing("AITileList_IndustryProducing"); @@ -79,6 +85,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITileList_StationType *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileList_StationType", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITileList_StationType"; } + void SQAITileList_StationType_Register(Squirrel *engine) { DefSQClass SQAITileList_StationType("AITileList_StationType"); diff --git a/src/ai/api/ai_town.hpp b/src/ai/api/ai_town.hpp index f74dc70f3..e73abb9cd 100644 --- a/src/ai/api/ai_town.hpp +++ b/src/ai/api/ai_town.hpp @@ -19,9 +19,6 @@ */ class AITown : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITown"; } - /** * Actions that one can perform on a town. */ diff --git a/src/ai/api/ai_town.hpp.sq b/src/ai/api/ai_town.hpp.sq index b7a33551f..da03de3fc 100644 --- a/src/ai/api/ai_town.hpp.sq +++ b/src/ai/api/ai_town.hpp.sq @@ -28,6 +28,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITown *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITown", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITown"; } + void SQAITown_Register(Squirrel *engine) { DefSQClass SQAITown("AITown"); diff --git a/src/ai/api/ai_townlist.hpp b/src/ai/api/ai_townlist.hpp index 1606935cc..f08a116ea 100644 --- a/src/ai/api/ai_townlist.hpp +++ b/src/ai/api/ai_townlist.hpp @@ -20,8 +20,6 @@ */ class AITownList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITownList"; } AITownList(); }; diff --git a/src/ai/api/ai_townlist.hpp.sq b/src/ai/api/ai_townlist.hpp.sq index bd05cc329..fe6211af0 100644 --- a/src/ai/api/ai_townlist.hpp.sq +++ b/src/ai/api/ai_townlist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITownList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITownList"; } + void SQAITownList_Register(Squirrel *engine) { DefSQClass SQAITownList("AITownList"); diff --git a/src/ai/api/ai_tunnel.hpp b/src/ai/api/ai_tunnel.hpp index b788f4511..18f14a03e 100644 --- a/src/ai/api/ai_tunnel.hpp +++ b/src/ai/api/ai_tunnel.hpp @@ -19,9 +19,6 @@ */ class AITunnel : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AITunnel"; } - /** * All tunnel related errors. */ diff --git a/src/ai/api/ai_tunnel.hpp.sq b/src/ai/api/ai_tunnel.hpp.sq index cc1e34feb..af7b2c0aa 100644 --- a/src/ai/api/ai_tunnel.hpp.sq +++ b/src/ai/api/ai_tunnel.hpp.sq @@ -24,6 +24,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AITunnel *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITunnel", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AITunnel"; } + void SQAITunnel_Register(Squirrel *engine) { DefSQClass SQAITunnel("AITunnel"); diff --git a/src/ai/api/ai_vehicle.hpp b/src/ai/api/ai_vehicle.hpp index bbcaac8b0..b994c810a 100644 --- a/src/ai/api/ai_vehicle.hpp +++ b/src/ai/api/ai_vehicle.hpp @@ -19,9 +19,6 @@ */ class AIVehicle : public AIObject { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicle"; } - /** * All vehicle related error messages. */ diff --git a/src/ai/api/ai_vehicle.hpp.sq b/src/ai/api/ai_vehicle.hpp.sq index 933233eaf..1d40354a5 100644 --- a/src/ai/api/ai_vehicle.hpp.sq +++ b/src/ai/api/ai_vehicle.hpp.sq @@ -28,6 +28,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicle *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicle", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicle"; } + void SQAIVehicle_Register(Squirrel *engine) { DefSQClass SQAIVehicle("AIVehicle"); diff --git a/src/ai/api/ai_vehiclelist.hpp b/src/ai/api/ai_vehiclelist.hpp index cce400839..e6b01c360 100644 --- a/src/ai/api/ai_vehiclelist.hpp +++ b/src/ai/api/ai_vehiclelist.hpp @@ -21,8 +21,6 @@ */ class AIVehicleList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList"; } AIVehicleList(); }; @@ -32,9 +30,6 @@ public: */ class AIVehicleList_Station : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList_Station"; } - /** * @param station_id The station to get the list of vehicles from, which have orders to it. * @pre AIBaseStation::IsValidBaseStation(station_id) @@ -52,9 +47,6 @@ public: */ class AIVehicleList_Depot : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList_Depot"; } - /** * @param tile The tile of the depot to get the list of vehicles from, which have orders to it. */ @@ -67,9 +59,6 @@ public: */ class AIVehicleList_SharedOrders : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList_SharedOrders"; } - /** * @param vehicle_id The vehicle that the rest shared orders with. */ @@ -82,9 +71,6 @@ public: */ class AIVehicleList_Group : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList_Group"; } - /** * @param group_id The ID of the group the vehicles are in. */ @@ -97,9 +83,6 @@ public: */ class AIVehicleList_DefaultGroup : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIVehicleList_DefaultGroup"; } - /** * @param vehicle_type The VehicleType to get the list of vehicles for. */ diff --git a/src/ai/api/ai_vehiclelist.hpp.sq b/src/ai/api/ai_vehiclelist.hpp.sq index bdb46655f..e4b535bad 100644 --- a/src/ai/api/ai_vehiclelist.hpp.sq +++ b/src/ai/api/ai_vehiclelist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList"; } + void SQAIVehicleList_Register(Squirrel *engine) { DefSQClass SQAIVehicleList("AIVehicleList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList_Station *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_Station", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList_Station"; } + void SQAIVehicleList_Station_Register(Squirrel *engine) { DefSQClass SQAIVehicleList_Station("AIVehicleList_Station"); @@ -56,6 +60,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList_Depot *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_Depot", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList_Depot"; } + void SQAIVehicleList_Depot_Register(Squirrel *engine) { DefSQClass SQAIVehicleList_Depot("AIVehicleList_Depot"); @@ -74,6 +80,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList_SharedOrders *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_SharedOrders", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList_SharedOrders"; } + void SQAIVehicleList_SharedOrders_Register(Squirrel *engine) { DefSQClass SQAIVehicleList_SharedOrders("AIVehicleList_SharedOrders"); @@ -92,6 +100,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList_Group *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_Group", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList_Group"; } + void SQAIVehicleList_Group_Register(Squirrel *engine) { DefSQClass SQAIVehicleList_Group("AIVehicleList_Group"); @@ -110,6 +120,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIVehicleList_DefaultGroup *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIVehicleList_DefaultGroup", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIVehicleList_DefaultGroup"; } + void SQAIVehicleList_DefaultGroup_Register(Squirrel *engine) { DefSQClass SQAIVehicleList_DefaultGroup("AIVehicleList_DefaultGroup"); diff --git a/src/ai/api/ai_waypoint.hpp b/src/ai/api/ai_waypoint.hpp index 6ffcbc64d..413035a46 100644 --- a/src/ai/api/ai_waypoint.hpp +++ b/src/ai/api/ai_waypoint.hpp @@ -19,9 +19,6 @@ */ class AIWaypoint : public AIBaseStation { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIWaypoint"; } - /** * Type of waypoints known in the game. */ diff --git a/src/ai/api/ai_waypoint.hpp.sq b/src/ai/api/ai_waypoint.hpp.sq index 516b5f31e..a3413b13e 100644 --- a/src/ai/api/ai_waypoint.hpp.sq +++ b/src/ai/api/ai_waypoint.hpp.sq @@ -26,6 +26,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIWaypoint *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIWaypoint", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIWaypoint"; } + void SQAIWaypoint_Register(Squirrel *engine) { DefSQClass SQAIWaypoint("AIWaypoint"); diff --git a/src/ai/api/ai_waypointlist.hpp b/src/ai/api/ai_waypointlist.hpp index 03bcd8e39..83642238f 100644 --- a/src/ai/api/ai_waypointlist.hpp +++ b/src/ai/api/ai_waypointlist.hpp @@ -21,9 +21,6 @@ */ class AIWaypointList : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIWaypointList"; } - /** * @param waypoint_type The type of waypoint to make a list of waypoints for. */ @@ -36,9 +33,6 @@ public: */ class AIWaypointList_Vehicle : public AIList { public: - /** Get the name of this class to identify it towards squirrel. */ - static const char *GetClassName() { return "AIWaypointList_Vehicle"; } - /** * @param vehicle_id The vehicle to get the list of waypoints he has in its orders from. */ diff --git a/src/ai/api/ai_waypointlist.hpp.sq b/src/ai/api/ai_waypointlist.hpp.sq index 1b0b3569b..dc0b18dd0 100644 --- a/src/ai/api/ai_waypointlist.hpp.sq +++ b/src/ai/api/ai_waypointlist.hpp.sq @@ -20,6 +20,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIWaypointList *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIWaypointList", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIWaypointList"; } + void SQAIWaypointList_Register(Squirrel *engine) { DefSQClass SQAIWaypointList("AIWaypointList"); @@ -38,6 +40,8 @@ namespace SQConvert { template <> int Return(HSQUIRRELVM vm, AIWaypointList_Vehicle *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIWaypointList_Vehicle", res, NULL, DefSQDestructorCallback); return 1; } } // namespace SQConvert +template <> const char *GetClassName() { return "AIWaypointList_Vehicle"; } + void SQAIWaypointList_Vehicle_Register(Squirrel *engine) { DefSQClass SQAIWaypointList_Vehicle("AIWaypointList_Vehicle"); diff --git a/src/ai/api/squirrel_export.awk b/src/ai/api/squirrel_export.awk index 5a817f94d..4d0e4ff13 100644 --- a/src/ai/api/squirrel_export.awk +++ b/src/ai/api/squirrel_export.awk @@ -209,6 +209,9 @@ BEGIN { print "} // namespace SQConvert" print ""; + print "template <> const char *GetClassName<" cls ">() { return \"" cls "\"; }" + print ""; + # Then do the registration functions of the class. */ print "void SQ" cls "_Register(Squirrel *engine)" print "{" @@ -414,7 +417,6 @@ BEGIN { cls_param[1] = len; cls_param[2] = types; } else if (substr(funcname, 0, 1) == "_" && types != "v") { - } else if (funcname == "GetClassName" && types == ".") { } else if (is_static) { static_method_size++ static_methods[static_method_size, 0] = funcname -- cgit v1.2.3-54-g00ecf