src/ai/api/ai_transactionmode.hpp.sq
author rubidium
Mon, 26 May 2008 20:00:18 +0000
branchnoai
changeset 10722 6ea1daff57aa
parent 10212 1e0a2a182253
child 10734 06f95974ac15
permissions -rw-r--r--
(svn r13272) [NoAI] -Codechange: strdup all parameter strings coming from Squirrel going into the API after the possible WChar* -> char* conversion and free them after return.
[NoAI] -Fix: signs getting strange names because the FS2OTTD buffer was already overwritten by commands/print attempts of other AIs.
10212
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9741
diff changeset
     1
/* $Id$ */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9741
diff changeset
     2
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 9741
diff changeset
     3
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     4
#include "ai_transactionmode.hpp"
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     5
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     6
namespace SQConvert {
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     7
	/* Allow AITransactionMode to be used as Squirrel parameter */
10722
6ea1daff57aa (svn r13272) [NoAI] -Codechange: strdup all parameter strings coming from Squirrel going into the API after the possible WChar* -> char* conversion and free them after return.
rubidium
parents: 10212
diff changeset
     8
	template <> AITransactionMode *GetParam(ForceType<AITransactionMode *>, HSQUIRRELVM vm, int index, SQConvertedStrings *str) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITransactionMode *)instance; }
6ea1daff57aa (svn r13272) [NoAI] -Codechange: strdup all parameter strings coming from Squirrel going into the API after the possible WChar* -> char* conversion and free them after return.
rubidium
parents: 10212
diff changeset
     9
	template <> AITransactionMode &GetParam(ForceType<AITransactionMode &>, HSQUIRRELVM vm, int index, SQConvertedStrings *str) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITransactionMode *)instance; }
6ea1daff57aa (svn r13272) [NoAI] -Codechange: strdup all parameter strings coming from Squirrel going into the API after the possible WChar* -> char* conversion and free them after return.
rubidium
parents: 10212
diff changeset
    10
	template <> const AITransactionMode *GetParam(ForceType<const AITransactionMode *>, HSQUIRRELVM vm, int index, SQConvertedStrings *str) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITransactionMode *)instance; }
6ea1daff57aa (svn r13272) [NoAI] -Codechange: strdup all parameter strings coming from Squirrel going into the API after the possible WChar* -> char* conversion and free them after return.
rubidium
parents: 10212
diff changeset
    11
	template <> const AITransactionMode &GetParam(ForceType<const AITransactionMode &>, HSQUIRRELVM vm, int index, SQConvertedStrings *str) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITransactionMode *)instance; }
9680
5ed7bbfd51c7 (svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents: 9679
diff changeset
    12
	template <> int Return<AITransactionMode *>(HSQUIRRELVM vm, AITransactionMode *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITransactionMode", res, NULL, DefSQDestructorCallback<AITransactionMode>); return 1; }
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    13
}; // namespace SQConvert
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    14
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9680
diff changeset
    15
void SQAITransactionMode_Register(Squirrel *engine) {
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    16
	DefSQClass <AITransactionMode> SQAITransactionMode("AITransactionMode");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    17
	SQAITransactionMode.PreRegister(engine);
9635
9ee82e091af7 (svn r10526) [NoAI] -Fix: a class with params for the constructor lost his instance when called from SQ (templates can be really useful ;))
truelight
parents: 9610
diff changeset
    18
	SQAITransactionMode.AddConstructor<void (AITransactionMode::*)(), 1>(engine, "x");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    19
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    20
	SQAITransactionMode.DefSQStaticMethod(engine, &AITransactionMode::GetClassName, "GetClassName", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    21
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    22
	SQAITransactionMode.DefSQMethod(engine, &AITransactionMode::Execute,  "Execute",  1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    23
	SQAITransactionMode.DefSQMethod(engine, &AITransactionMode::Stop,     "Stop",     1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    24
	SQAITransactionMode.DefSQMethod(engine, &AITransactionMode::Rollback, "Rollback", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    25
	SQAITransactionMode.DefSQMethod(engine, &AITransactionMode::GetCosts, "GetCosts", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    26
	SQAITransactionMode.DefSQMethod(engine, &AITransactionMode::Append,   "Append",   2, "xx");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    27
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    28
	SQAITransactionMode.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    29
}