truelight@9652: #include "ai_pathfinder_stupid.hpp" truelight@9652: truelight@9652: namespace SQConvert { truelight@9652: /* Allow AIPathFinderStupid to be used as Squirrel parameter */ truelight@9652: template <> AIPathFinderStupid *GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIPathFinderStupid *)instance; } truelight@9652: template <> AIPathFinderStupid &GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIPathFinderStupid *)instance; } truelight@9652: template <> const AIPathFinderStupid *GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIPathFinderStupid *)instance; } truelight@9652: template <> const AIPathFinderStupid &GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIPathFinderStupid *)instance; } truelight@9680: template <> int Return(HSQUIRRELVM vm, AIPathFinderStupid *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIPathFinderStupid", res, NULL, DefSQDestructorCallback); return 1; } truelight@9652: }; // namespace SQConvert truelight@9652: truelight@9652: void SQAIPathFinderStupidRegister(Squirrel *engine) { truelight@9652: DefSQClass SQAIPathFinderStupid("AIPathFinderStupid"); truelight@9652: SQAIPathFinderStupid.PreRegister(engine, "AIPathFinder"); truelight@9652: SQAIPathFinderStupid.AddConstructor(engine, "xi"); truelight@9652: truelight@9652: SQAIPathFinderStupid.DefSQStaticMethod(engine, &AIPathFinderStupid::GetClassName, "GetClassName", 1, "x"); truelight@9652: truelight@9652: SQAIPathFinderStupid.DefSQMethod(engine, &AIPathFinderStupid::FindRoute, "FindRoute", 3, "xxx"); truelight@9652: SQAIPathFinderStupid.DefSQMethod(engine, &AIPathFinderStupid::BuildRoute, "BuildRoute", 2, "xp"); truelight@9652: SQAIPathFinderStupid.DefSQMethod(engine, &AIPathFinderStupid::FreeRoute, "FreeRoute", 2, "xp"); truelight@9652: truelight@9652: SQAIPathFinderStupid.PostRegister(engine); truelight@9652: }