From 98103121d4f2ed1f1581919b7b1f343ccd410c12 Mon Sep 17 00:00:00 2001 From: truebrain Date: Tue, 29 Nov 2011 23:15:35 +0000 Subject: (svn r23355) -Codechange: rename all AI* to Script* (Rubidium) --- src/ai/api/ai_group.hpp.sq | 64 +++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 32 deletions(-) (limited to 'src/ai/api/ai_group.hpp.sq') diff --git a/src/ai/api/ai_group.hpp.sq b/src/ai/api/ai_group.hpp.sq index 4b0cc7b22..d4e696d5d 100644 --- a/src/ai/api/ai_group.hpp.sq +++ b/src/ai/api/ai_group.hpp.sq @@ -13,44 +13,44 @@ namespace SQConvert { /* Allow enums to be used as Squirrel parameters */ - template <> inline AIGroup::GroupID GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIGroup::GroupID)tmp; } - template <> inline int Return(HSQUIRRELVM vm, AIGroup::GroupID res) { sq_pushinteger(vm, (int32)res); return 1; } - - /* Allow AIGroup to be used as Squirrel parameter */ - template <> inline AIGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIGroup *)instance; } - template <> inline AIGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIGroup *)instance; } - template <> inline const AIGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIGroup *)instance; } - template <> inline const AIGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIGroup *)instance; } - template <> inline int Return(HSQUIRRELVM vm, AIGroup *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Group", res, NULL, DefSQDestructorCallback, true); return 1; } + template <> inline ScriptGroup::GroupID GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (ScriptGroup::GroupID)tmp; } + template <> inline int Return(HSQUIRRELVM vm, ScriptGroup::GroupID res) { sq_pushinteger(vm, (int32)res); return 1; } + + /* Allow ScriptGroup to be used as Squirrel parameter */ + template <> inline ScriptGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptGroup *)instance; } + template <> inline ScriptGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGroup *)instance; } + template <> inline const ScriptGroup *GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptGroup *)instance; } + template <> inline const ScriptGroup &GetParam(ForceType, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptGroup *)instance; } + template <> inline int Return(HSQUIRRELVM vm, ScriptGroup *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Group", res, NULL, DefSQDestructorCallback, true); return 1; } } // namespace SQConvert -template <> const char *GetClassName() { return "AIGroup"; } +template <> const char *GetClassName() { return "AIGroup"; } void SQAIGroup_Register(Squirrel *engine) { - DefSQClass SQAIGroup("AIGroup"); + DefSQClass SQAIGroup("AIGroup"); SQAIGroup.PreRegister(engine); - SQAIGroup.AddConstructor(engine, "x"); - - SQAIGroup.DefSQConst(engine, AIGroup::GROUP_ALL, "GROUP_ALL"); - SQAIGroup.DefSQConst(engine, AIGroup::GROUP_DEFAULT, "GROUP_DEFAULT"); - SQAIGroup.DefSQConst(engine, AIGroup::GROUP_INVALID, "GROUP_INVALID"); - - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::IsValidGroup, "IsValidGroup", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::CreateGroup, "CreateGroup", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::DeleteGroup, "DeleteGroup", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetVehicleType, "GetVehicleType", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::SetName, "SetName", 3, ".i."); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetName, "GetName", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::EnableAutoReplaceProtection, "EnableAutoReplaceProtection", 3, ".ib"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetAutoReplaceProtection, "GetAutoReplaceProtection", 2, ".i"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetNumEngines, "GetNumEngines", 3, ".ii"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::MoveVehicle, "MoveVehicle", 3, ".ii"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::EnableWagonRemoval, "EnableWagonRemoval", 2, ".b"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::HasWagonRemoval, "HasWagonRemoval", 1, "."); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::SetAutoReplace, "SetAutoReplace", 4, ".iii"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::GetEngineReplacement, "GetEngineReplacement", 3, ".ii"); - SQAIGroup.DefSQStaticMethod(engine, &AIGroup::StopAutoReplace, "StopAutoReplace", 3, ".ii"); + SQAIGroup.AddConstructor(engine, "x"); + + SQAIGroup.DefSQConst(engine, ScriptGroup::GROUP_ALL, "GROUP_ALL"); + SQAIGroup.DefSQConst(engine, ScriptGroup::GROUP_DEFAULT, "GROUP_DEFAULT"); + SQAIGroup.DefSQConst(engine, ScriptGroup::GROUP_INVALID, "GROUP_INVALID"); + + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::IsValidGroup, "IsValidGroup", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::CreateGroup, "CreateGroup", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::DeleteGroup, "DeleteGroup", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::GetVehicleType, "GetVehicleType", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::SetName, "SetName", 3, ".i."); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::GetName, "GetName", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::EnableAutoReplaceProtection, "EnableAutoReplaceProtection", 3, ".ib"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::GetAutoReplaceProtection, "GetAutoReplaceProtection", 2, ".i"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::GetNumEngines, "GetNumEngines", 3, ".ii"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::MoveVehicle, "MoveVehicle", 3, ".ii"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::EnableWagonRemoval, "EnableWagonRemoval", 2, ".b"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::HasWagonRemoval, "HasWagonRemoval", 1, "."); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::SetAutoReplace, "SetAutoReplace", 4, ".iii"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::GetEngineReplacement, "GetEngineReplacement", 3, ".ii"); + SQAIGroup.DefSQStaticMethod(engine, &ScriptGroup::StopAutoReplace, "StopAutoReplace", 3, ".ii"); SQAIGroup.PostRegister(engine); } -- cgit v1.2.3-70-g09d2