diff -r 506580e51cbb -r 634100485aca src/ai/api/ai_pathfinder.hpp.sq --- a/src/ai/api/ai_pathfinder.hpp.sq Mon Mar 31 06:33:22 2008 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,26 +0,0 @@ -#include "ai_pathfinder.hpp" - -namespace SQConvert { - /* Allow enums to be used as Squirrel parameters */ - template <> AIPathFinder::PathFinderType GetParam(ForceType, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIPathFinder::PathFinderType)tmp; } - template <> int Return(HSQUIRRELVM vm, AIPathFinder::PathFinderType res) { sq_pushinteger(vm, (int32)res); return 1; } - - /* Allow AIPathFinder to be used as Squirrel parameter */ - template <> AIPathFinder *GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIPathFinder *)instance; } - template <> AIPathFinder &GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIPathFinder *)instance; } - template <> const AIPathFinder *GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIPathFinder *)instance; } - template <> const AIPathFinder &GetParam(ForceType, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIPathFinder *)instance; } - template <> int Return(HSQUIRRELVM vm, AIPathFinder *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIPathFinder", res, NULL, DefSQDestructorCallback); return 1; } -}; // namespace SQConvert - -void SQAIPathFinder_Register(Squirrel *engine) { - DefSQClass SQAIPathFinder("AIPathFinder"); - SQAIPathFinder.PreRegister(engine); - - SQAIPathFinder.DefSQConst(engine, AIPathFinder::PATHFINDER_ROAD, "PATHFINDER_ROAD"); - SQAIPathFinder.DefSQConst(engine, AIPathFinder::PATHFINDER_RAIL, "PATHFINDER_RAIL"); - - SQAIPathFinder.DefSQStaticMethod(engine, &AIPathFinder::GetClassName, "GetClassName", 1, "x"); - - SQAIPathFinder.PostRegister(engine); -}