From ffe2caf20f12f70dfc3b8b552ce2ee44ec2e477d Mon Sep 17 00:00:00 2001 From: yexo Date: Wed, 4 Mar 2009 22:37:25 +0000 Subject: (svn r15614) -Add [NoAI]: AIVehicleList_Group(group_id) and AIVehicleList_DefaultGroup(vehicle_type). --- src/ai/api/ai_vehiclelist.hpp.sq | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'src/ai/api/ai_vehiclelist.hpp.sq') diff --git a/src/ai/api/ai_vehiclelist.hpp.sq b/src/ai/api/ai_vehiclelist.hpp.sq index b5af401a1..9f00f61d8 100644 --- a/src/ai/api/ai_vehiclelist.hpp.sq +++ b/src/ai/api/ai_vehiclelist.hpp.sq @@ -53,3 +53,37 @@ void SQAIVehicleList_SharedOrders_Register(Squirrel *engine) { SQAIVehicleList_SharedOrders.PostRegister(engine); } + +namespace SQConvert { + /* Allow AIVehicleList_Group to be used as Squirrel parameter */ + template <> AIVehicleList_Group *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_Group *)instance; } + template <> AIVehicleList_Group &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_Group *)instance; } + template <> const AIVehicleList_Group *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_Group *)instance; } + template <> const AIVehicleList_Group &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_Group *)instance; } + 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 + +void SQAIVehicleList_Group_Register(Squirrel *engine) { + DefSQClass SQAIVehicleList_Group("AIVehicleList_Group"); + SQAIVehicleList_Group.PreRegister(engine, "AIAbstractList"); + SQAIVehicleList_Group.AddConstructor(engine, "xi"); + + SQAIVehicleList_Group.PostRegister(engine); +} + +namespace SQConvert { + /* Allow AIVehicleList_DefaultGroup to be used as Squirrel parameter */ + template <> AIVehicleList_DefaultGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_DefaultGroup *)instance; } + template <> AIVehicleList_DefaultGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_DefaultGroup *)instance; } + template <> const AIVehicleList_DefaultGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIVehicleList_DefaultGroup *)instance; } + template <> const AIVehicleList_DefaultGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIVehicleList_DefaultGroup *)instance; } + 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 + +void SQAIVehicleList_DefaultGroup_Register(Squirrel *engine) { + DefSQClass SQAIVehicleList_DefaultGroup("AIVehicleList_DefaultGroup"); + SQAIVehicleList_DefaultGroup.PreRegister(engine, "AIAbstractList"); + SQAIVehicleList_DefaultGroup.AddConstructor(engine, "xi"); + + SQAIVehicleList_DefaultGroup.PostRegister(engine); +} -- cgit v1.2.3-70-g09d2