68 }; |
68 }; |
69 |
69 |
70 #ifdef DEFINE_SQUIRREL_CLASS |
70 #ifdef DEFINE_SQUIRREL_CLASS |
71 namespace SQConvert { |
71 namespace SQConvert { |
72 /* Allow AITown to be used as Squirrel parameter */ |
72 /* Allow AITown to be used as Squirrel parameter */ |
73 template <> AITown *GetParam(ForceType<AITown *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITown *)instance; } |
73 template <> AITown *GetParam(ForceType<AITown *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITown *)instance; } |
|
74 template <> AITown &GetParam(ForceType<AITown &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITown *)instance; } |
|
75 template <> const AITown *GetParam(ForceType<const AITown *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITown *)instance; } |
|
76 template <> const AITown &GetParam(ForceType<const AITown &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITown *)instance; } |
74 }; // namespace SQConvert |
77 }; // namespace SQConvert |
75 |
78 |
76 void SQAITownRegister(Squirrel *engine) { |
79 void SQAITownRegister(Squirrel *engine) { |
77 DefSQClass <AITown> SQAITown("AITown"); |
80 DefSQClass <AITown> SQAITown("AITown"); |
78 SQAITown.PreRegister(engine); |
81 SQAITown.PreRegister(engine); |