126 }; |
126 }; |
127 |
127 |
128 #ifdef DEFINE_SQUIRREL_CLASS |
128 #ifdef DEFINE_SQUIRREL_CLASS |
129 namespace SQConvert { |
129 namespace SQConvert { |
130 /* Allow AIMap to be used as Squirrel parameter */ |
130 /* Allow AIMap to be used as Squirrel parameter */ |
131 template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; } |
131 template <> AIMap *GetParam(ForceType<AIMap *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; } |
|
132 template <> AIMap &GetParam(ForceType<AIMap &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; } |
|
133 template <> const AIMap *GetParam(ForceType<const AIMap *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIMap *)instance; } |
|
134 template <> const AIMap &GetParam(ForceType<const AIMap &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIMap *)instance; } |
132 }; // namespace SQConvert |
135 }; // namespace SQConvert |
133 |
136 |
134 void SQAIMapRegister(Squirrel *engine) { |
137 void SQAIMapRegister(Squirrel *engine) { |
135 DefSQClass <AIMap> SQAIMap("AIMap"); |
138 DefSQClass <AIMap> SQAIMap("AIMap"); |
136 SQAIMap.PreRegister(engine); |
139 SQAIMap.PreRegister(engine); |