--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/ai/api/ai_event.hpp.sq Thu Jul 19 22:39:43 2007 +0000
@@ -0,0 +1,58 @@
+#include "ai_event.hpp"
+
+namespace SQConvert {
+ /* Allow enums to be used as Squirrel parameters */
+ template <> AIEvent::AIEventType GetParam(ForceType<AIEvent::AIEventType>, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIEvent::AIEventType)tmp; }
+ template <> int Return<AIEvent::AIEventType>(HSQUIRRELVM vm, AIEvent::AIEventType res) { sq_pushinteger(vm, (int32)res); return 1; }
+
+ /* Allow AIEvent to be used as Squirrel parameter */
+ template <> AIEvent *GetParam(ForceType<AIEvent *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEvent *)instance; }
+ template <> AIEvent &GetParam(ForceType<AIEvent &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEvent *)instance; }
+ template <> const AIEvent *GetParam(ForceType<const AIEvent *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEvent *)instance; }
+ template <> const AIEvent &GetParam(ForceType<const AIEvent &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEvent *)instance; }
+ template <> int Return<AIEvent *>(HSQUIRRELVM vm, AIEvent *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEvent", res, NULL, DefSQDestructorCallback<AIEvent>); return 1; }
+}; // namespace SQConvert
+
+void SQAIEventRegister(Squirrel *engine) {
+ DefSQClass <AIEvent> SQAIEvent("AIEvent");
+ SQAIEvent.PreRegister(engine);
+ SQAIEvent.AddConstructor<void (AIEvent::*)(AIEvent::AIEventType type), 2>(engine, "xi");
+
+ SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_INVALID, "AI_ET_INVALID");
+ SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_TEST, "AI_ET_TEST");
+ SQAIEvent.DefSQConst(engine, AIEvent::AI_ET_CRASHED_VEHICLE, "AI_ET_CRASHED_VEHICLE");
+
+ SQAIEvent.DefSQStaticMethod(engine, &AIEvent::GetClassName, "GetClassName", 1, "x");
+
+ SQAIEvent.DefSQMethod(engine, &AIEvent::GetEventType, "GetEventType", 1, "x");
+
+ SQAIEvent.PostRegister(engine);
+}
+
+namespace SQConvert {
+ /* Allow AIEventController to be used as Squirrel parameter */
+ template <> AIEventController *GetParam(ForceType<AIEventController *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEventController *)instance; }
+ template <> AIEventController &GetParam(ForceType<AIEventController &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventController *)instance; }
+ template <> const AIEventController *GetParam(ForceType<const AIEventController *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIEventController *)instance; }
+ template <> const AIEventController &GetParam(ForceType<const AIEventController &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIEventController *)instance; }
+ template <> int Return<AIEventController *>(HSQUIRRELVM vm, AIEventController *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIEventController", res, NULL, DefSQDestructorCallback<AIEventController>); return 1; }
+}; // namespace SQConvert
+
+void SQAIEventControllerRegister(Squirrel *engine) {
+ DefSQClass <AIEventController> SQAIEventController("AIEventController");
+ SQAIEventController.PreRegister(engine);
+ SQAIEventController.AddConstructor<void (AIEventController::*)(), 1>(engine, "x");
+
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::GetClassName, "GetClassName", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::IsEventWaiting, "IsEventWaiting", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::GetNextEvent, "GetNextEvent", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::DisableEvent, "DisableEvent", 2, "xi");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::EnableEvent, "EnableEvent", 2, "xi");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::DisableAllEvents, "DisableAllEvents", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::EnableAllEvents, "EnableAllEvents", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::InsertEvent, "InsertEvent", 2, "xx");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::Test, "Test", 1, "x");
+ SQAIEventController.DefSQStaticMethod(engine, &AIEventController::FreeEventPointer, "FreeEventPointer", 1, "x");
+
+ SQAIEventController.PostRegister(engine);
+}