author | truebrain |
Wed, 23 Apr 2008 12:05:32 +0000 | |
branch | noai |
changeset 10308 | 0c81dfce3e9b |
parent 10291 | 11cb78922367 |
child 10722 | 6ea1daff57aa |
permissions | -rw-r--r-- |
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 */ |
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
|
8 |
template <> AICompany::CompanyIndex GetParam(ForceType<AICompany::CompanyIndex>, HSQUIRRELVM vm, int index) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICompany::CompanyIndex)tmp; } |
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
|
9 |
template <> int Return<AICompany::CompanyIndex>(HSQUIRRELVM vm, AICompany::CompanyIndex res) { sq_pushinteger(vm, (int32)res); return 1; } |
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 */ |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
12 |
template <> AICompany *GetParam(ForceType<AICompany *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
13 |
template <> AICompany &GetParam(ForceType<AICompany &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICompany *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
14 |
template <> const AICompany *GetParam(ForceType<const AICompany *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICompany *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
15 |
template <> const AICompany &GetParam(ForceType<const AICompany &>, HSQUIRRELVM vm, int index) { 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 |
|
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
|
24 |
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
|
25 |
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
|
26 |
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
|
27 |
SQAICompany.DefSQConst(engine, AICompany::INVALID_COMPANY, "INVALID_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"); |
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
|
30 |
SQAICompany.DefSQStaticMethod(engine, &AICompany::ResolveCompanyIndex, "ResolveCompanyIndex", 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
|
31 |
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
|
32 |
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
|
33 |
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
|
34 |
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
|
35 |
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
|
36 |
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
|
37 |
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
|
38 |
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
|
39 |
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
|
40 |
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
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
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
|
48 |
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
|
49 |
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
|
50 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
51 |
SQAICompany.PostRegister(engine); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
52 |
} |