summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_cargolist.hpp.sq
diff options
context:
space:
mode:
Diffstat (limited to 'src/ai/api/ai_cargolist.hpp.sq')
-rw-r--r--src/ai/api/ai_cargolist.hpp.sq18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ai/api/ai_cargolist.hpp.sq b/src/ai/api/ai_cargolist.hpp.sq
index 14c727c05..2ba0154a4 100644
--- a/src/ai/api/ai_cargolist.hpp.sq
+++ b/src/ai/api/ai_cargolist.hpp.sq
@@ -64,3 +64,21 @@ void SQAICargoList_IndustryProducing_Register(Squirrel *engine)
SQAICargoList_IndustryProducing.PostRegister(engine);
}
+
+namespace SQConvert {
+ /* Allow AICargoList_StationAccepting to be used as Squirrel parameter */
+ template <> AICargoList_StationAccepting *GetParam(ForceType<AICargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICargoList_StationAccepting *)instance; }
+ template <> AICargoList_StationAccepting &GetParam(ForceType<AICargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_StationAccepting *)instance; }
+ template <> const AICargoList_StationAccepting *GetParam(ForceType<const AICargoList_StationAccepting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICargoList_StationAccepting *)instance; }
+ template <> const AICargoList_StationAccepting &GetParam(ForceType<const AICargoList_StationAccepting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargoList_StationAccepting *)instance; }
+ template <> int Return<AICargoList_StationAccepting *>(HSQUIRRELVM vm, AICargoList_StationAccepting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargoList_StationAccepting", res, NULL, DefSQDestructorCallback<AICargoList_StationAccepting>); return 1; }
+} // namespace SQConvert
+
+void SQAICargoList_StationAccepting_Register(Squirrel *engine)
+{
+ DefSQClass <AICargoList_StationAccepting> SQAICargoList_StationAccepting("AICargoList_StationAccepting");
+ SQAICargoList_StationAccepting.PreRegister(engine, "AIList");
+ SQAICargoList_StationAccepting.AddConstructor<void (AICargoList_StationAccepting::*)(StationID station_id), 2>(engine, "xi");
+
+ SQAICargoList_StationAccepting.PostRegister(engine);
+}