author | rubidium |
Sun, 15 Jul 2007 16:39:11 +0000 | |
branch | noai |
changeset 9668 | 6fe3d2cb9655 |
parent 9649 | bc8c06513f5b |
child 9673 | ee4f133c84ec |
permissions | -rw-r--r-- |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
1 |
#include "ai_industry.hpp" |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
2 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
3 |
namespace SQConvert { |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
4 |
/* Allow AIIndustry 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
|
5 |
template <> AIIndustry *GetParam(ForceType<AIIndustry *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustry *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
6 |
template <> AIIndustry &GetParam(ForceType<AIIndustry &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustry *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
7 |
template <> const AIIndustry *GetParam(ForceType<const AIIndustry *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustry *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
8 |
template <> const AIIndustry &GetParam(ForceType<const AIIndustry &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustry *)instance; } |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
9 |
}; // namespace SQConvert |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
10 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
11 |
void SQAIIndustryRegister(Squirrel *engine) { |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
12 |
DefSQClass <AIIndustry> SQAIIndustry("AIIndustry"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
13 |
SQAIIndustry.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
|
14 |
SQAIIndustry.AddConstructor<void (AIIndustry::*)(), 1>(engine, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
15 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
16 |
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetClassName, "GetClassName", 1, "x"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
17 |
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::IsValidIndustry, "IsValidIndustry", 2, "xi"); |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9635
diff
changeset
|
18 |
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetProduction, "GetProduction", 3, "xii"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
9635
diff
changeset
|
19 |
SQAIIndustry.DefSQStaticMethod(engine, &AIIndustry::GetLocation, "GetLocation", 2, "xi"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
20 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
21 |
SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetMaxIndustryID, "GetMaxIndustryID", 1, "x"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
22 |
SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetIndustryCount, "GetIndustryCount", 1, "x"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
23 |
SQAIIndustry.DefSQMethod(engine, &AIIndustry::GetName, "GetName", 2, "xi"); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
24 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
25 |
SQAIIndustry.PostRegister(engine); |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
26 |
} |