src/ai/api/ai_company.hpp.sq
author truebrain
Sun, 08 Jun 2008 21:20:48 +0000
branchnoai
changeset 10871 326ee226e9d7
parent 10856 c7b29152d594
permissions -rw-r--r--
(svn r13422) [NoAI] -Change [API CHANGE]: remove Stop() as part of the AIController. This means you no longer need to have a Stop() function in your AI, nor is it ever called. This because it was silly, never used, and couldn't do anything real (all Sleep/DoCommands resulted in an assert, as the game expected the company to be gone).
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: 9829
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: 9829
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: 9829
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_company.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 {
9668
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
     7
	/* Allow enums to be used as Squirrel parameters */
10855
90904faa1890 (svn r13406) [NoAI] -Change [API CHANGE]: renamed CompanyIndex to CompanyID and AICompany::ResolveCompanyIndex() to AICompany::ResolveCompanyID(), to be more consistant with the rest of the API
truebrain
parents: 10734
diff changeset
     8
	template <> AICompany::CompanyID GetParam(ForceType<AICompany::CompanyID>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyID)tmp; }
90904faa1890 (svn r13406) [NoAI] -Change [API CHANGE]: renamed CompanyIndex to CompanyID and AICompany::ResolveCompanyIndex() to AICompany::ResolveCompanyID(), to be more consistant with the rest of the API
truebrain
parents: 10734
diff changeset
     9
	template <> int Return<AICompany::CompanyID>(HSQUIRRELVM vm, AICompany::CompanyID res) { sq_pushinteger(vm, (int32)res); return 1; }
9668
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
    10
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    11
	/* Allow AICompany to be used as Squirrel parameter */
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    12
	template <> AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICompany *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    13
	template <> AICompany &GetParam(ForceType<AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    14
	template <> const AICompany *GetParam(ForceType<const AICompany *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AICompany *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    15
	template <> const AICompany &GetParam(ForceType<const AICompany &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)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
    16
	template <> int Return<AICompany *>(HSQUIRRELVM vm, AICompany *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICompany", res, NULL, DefSQDestructorCallback<AICompany>); return 1; }
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    17
}; // namespace SQConvert
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    18
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9737
diff changeset
    19
void SQAICompany_Register(Squirrel *engine) {
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    20
	DefSQClass <AICompany> SQAICompany("AICompany");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    21
	SQAICompany.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
    22
	SQAICompany.AddConstructor<void (AICompany::*)(), 1>(engine, "x");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    23
10856
c7b29152d594 (svn r13407) [NoAI] -Add: added AICompany::IsMine() to ease up owner-checks (no, not the ones to cash in money)
truebrain
parents: 10855
diff changeset
    24
	SQAICompany.DefSQConst(engine, AICompany::INVALID_COMPANY, "INVALID_COMPANY");
9668
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
    25
	SQAICompany.DefSQConst(engine, AICompany::FIRST_COMPANY,   "FIRST_COMPANY");
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
    26
	SQAICompany.DefSQConst(engine, AICompany::LAST_COMPANY,    "LAST_COMPANY");
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
    27
	SQAICompany.DefSQConst(engine, AICompany::MY_COMPANY,      "MY_COMPANY");
6fe3d2cb9655 (svn r10582) [NoAI] -Codechange: allow getting the president and company names of other companies as well as their company value and bank balance.
rubidium
parents: 9635
diff changeset
    28
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    29
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetClassName,         "GetClassName",         1, "x");
10855
90904faa1890 (svn r13406) [NoAI] -Change [API CHANGE]: renamed CompanyIndex to CompanyID and AICompany::ResolveCompanyIndex() to AICompany::ResolveCompanyID(), to be more consistant with the rest of the API
truebrain
parents: 10734
diff changeset
    30
	SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyID,     "ResolveCompanyID",     2, "xi");
10856
c7b29152d594 (svn r13407) [NoAI] -Add: added AICompany::IsMine() to ease up owner-checks (no, not the ones to cash in money)
truebrain
parents: 10855
diff changeset
    31
	SQAICompany.DefSQStaticMethod(engine, &AICompany::IsMine,               "IsMine",               2, "xi");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    32
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetCompanyName,       "SetCompanyName",       2, "xs");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    33
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetCompanyName,       "GetCompanyName",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    34
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetPresidentName,     "SetPresidentName",     2, "xs");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    35
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetPresidentName,     "GetPresidentName",     2, "xi");
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    36
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetLoanAmount,        "SetLoanAmount",        2, "xi");
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    37
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetMinimumLoanAmount, "SetMinimumLoanAmount", 2, "xi");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    38
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanAmount,        "GetLoanAmount",        1, "x");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    39
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetMaxLoanAmount,     "GetMaxLoanAmount",     1, "x");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    40
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetLoanInterval,      "GetLoanInterval",      1, "x");
9829
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    41
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetCompanyValue,      "GetCompanyValue",      2, "xi");
80fbe02a4184 (svn r12491) [NoAI] -Documentation: made parts of the comments more uniform (@file header and class header)
truebrain
parents: 9808
diff changeset
    42
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetBankBalance,       "GetBankBalance",       2, "xi");
9808
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9741
diff changeset
    43
	SQAICompany.DefSQStaticMethod(engine, &AICompany::BuildCompanyHQ,       "BuildCompanyHQ",       2, "xi");
0b40f556e051 (svn r12318) [NoAI] -Add: added AICompany::(Build|Get)CompanyHQ (college of Morloth)
truebrain
parents: 9741
diff changeset
    44
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetCompanyHQ,         "GetCompanyHQ",         2, "xi");
10291
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    45
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewStatus,   "SetAutoRenewStatus",   2, "xb");
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    46
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewStatus,   "GetAutoRenewStatus",   2, "xi");
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    47
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMonths,   "SetAutoRenewMonths",   2, "xi");
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    48
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMonths,   "GetAutoRenewMonths",   2, "xi");
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    49
	SQAICompany.DefSQStaticMethod(engine, &AICompany::SetAutoRenewMoney,    "SetAutoRenewMoney",    2, "xi");
11cb78922367 (svn r12823) [NoAI] -Add: added AICompany::(G|S)etAutoRenew(Status|Months|Money)
glx
parents: 10212
diff changeset
    50
	SQAICompany.DefSQStaticMethod(engine, &AICompany::GetAutoRenewMoney,    "GetAutoRenewMoney",    2, "xi");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    51
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    52
	SQAICompany.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    53
}