summaryrefslogtreecommitdiff
path: root/src/ai/api/ai_accounting.hpp.sq
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-11-29 23:15:35 +0000
committertruebrain <truebrain@openttd.org>2011-11-29 23:15:35 +0000
commit98103121d4f2ed1f1581919b7b1f343ccd410c12 (patch)
tree1e760dd6517a6b0f9fb669ec277139a8e3f9a4a3 /src/ai/api/ai_accounting.hpp.sq
parentafdb67a3534f85b4efbd3327ece8137211042d7b (diff)
downloadopenttd-98103121d4f2ed1f1581919b7b1f343ccd410c12.tar.xz
(svn r23355) -Codechange: rename all AI* to Script* (Rubidium)
Diffstat (limited to 'src/ai/api/ai_accounting.hpp.sq')
-rw-r--r--src/ai/api/ai_accounting.hpp.sq22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ai/api/ai_accounting.hpp.sq b/src/ai/api/ai_accounting.hpp.sq
index f3513f7dd..0e0aba3b8 100644
--- a/src/ai/api/ai_accounting.hpp.sq
+++ b/src/ai/api/ai_accounting.hpp.sq
@@ -12,24 +12,24 @@
#include "../../script/api/script_accounting.hpp"
namespace SQConvert {
- /* Allow AIAccounting to be used as Squirrel parameter */
- template <> inline AIAccounting *GetParam(ForceType<AIAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAccounting *)instance; }
- template <> inline AIAccounting &GetParam(ForceType<AIAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAccounting *)instance; }
- template <> inline const AIAccounting *GetParam(ForceType<const AIAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIAccounting *)instance; }
- template <> inline const AIAccounting &GetParam(ForceType<const AIAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIAccounting *)instance; }
- template <> inline int Return<AIAccounting *>(HSQUIRRELVM vm, AIAccounting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Accounting", res, NULL, DefSQDestructorCallback<AIAccounting>, true); return 1; }
+ /* Allow ScriptAccounting to be used as Squirrel parameter */
+ template <> inline ScriptAccounting *GetParam(ForceType<ScriptAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptAccounting *)instance; }
+ template <> inline ScriptAccounting &GetParam(ForceType<ScriptAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAccounting *)instance; }
+ template <> inline const ScriptAccounting *GetParam(ForceType<const ScriptAccounting *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (ScriptAccounting *)instance; }
+ template <> inline const ScriptAccounting &GetParam(ForceType<const ScriptAccounting &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(ScriptAccounting *)instance; }
+ template <> inline int Return<ScriptAccounting *>(HSQUIRRELVM vm, ScriptAccounting *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "Accounting", res, NULL, DefSQDestructorCallback<ScriptAccounting>, true); return 1; }
} // namespace SQConvert
-template <> const char *GetClassName<AIAccounting, ST_AI>() { return "AIAccounting"; }
+template <> const char *GetClassName<ScriptAccounting, ST_AI>() { return "AIAccounting"; }
void SQAIAccounting_Register(Squirrel *engine)
{
- DefSQClass<AIAccounting, ST_AI> SQAIAccounting("AIAccounting");
+ DefSQClass<ScriptAccounting, ST_AI> SQAIAccounting("AIAccounting");
SQAIAccounting.PreRegister(engine);
- SQAIAccounting.AddConstructor<void (AIAccounting::*)(), 1>(engine, "x");
+ SQAIAccounting.AddConstructor<void (ScriptAccounting::*)(), 1>(engine, "x");
- SQAIAccounting.DefSQMethod(engine, &AIAccounting::GetCosts, "GetCosts", 1, "x");
- SQAIAccounting.DefSQMethod(engine, &AIAccounting::ResetCosts, "ResetCosts", 1, "x");
+ SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::GetCosts, "GetCosts", 1, "x");
+ SQAIAccounting.DefSQMethod(engine, &ScriptAccounting::ResetCosts, "ResetCosts", 1, "x");
SQAIAccounting.PostRegister(engine);
}