| author | truebrain |
| Mon, 30 Jun 2008 12:15:10 +0000 | |
| branch | noai |
| changeset 11097 | 6967c52c78c5 |
| parent 10831 | f7e17819358b |
| 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:
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_cargo.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 {
|
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
7 |
/* Allow enums to be used as Squirrel parameters */ |
|
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
|
8 |
template <> AICargo::CargoClass GetParam(ForceType<AICargo::CargoClass>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICargo::CargoClass)tmp; }
|
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
9 |
template <> int Return<AICargo::CargoClass>(HSQUIRRELVM vm, AICargo::CargoClass res) { sq_pushinteger(vm, (int32)res); return 1; }
|
|
10831
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
10 |
template <> AICargo::TownEffect GetParam(ForceType<AICargo::TownEffect>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AICargo::TownEffect)tmp; }
|
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
11 |
template <> int Return<AICargo::TownEffect>(HSQUIRRELVM vm, AICargo::TownEffect res) { sq_pushinteger(vm, (int32)res); return 1; }
|
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
12 |
|
|
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
13 |
/* Allow AICargo 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
|
14 |
template <> AICargo *GetParam(ForceType<AICargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICargo *)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 <> AICargo &GetParam(ForceType<AICargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargo *)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
|
16 |
template <> const AICargo *GetParam(ForceType<const AICargo *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AICargo *)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
|
17 |
template <> const AICargo &GetParam(ForceType<const AICargo &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AICargo *)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
|
18 |
template <> int Return<AICargo *>(HSQUIRRELVM vm, AICargo *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AICargo", res, NULL, DefSQDestructorCallback<AICargo>); return 1; }
|
|
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
19 |
}; // namespace SQConvert |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
20 |
|
|
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
|
21 |
void SQAICargo_Register(Squirrel *engine) {
|
|
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
22 |
DefSQClass <AICargo> SQAICargo("AICargo");
|
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
23 |
SQAICargo.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
|
24 |
SQAICargo.AddConstructor<void (AICargo::*)(), 1>(engine, "x"); |
|
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
25 |
|
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
26 |
SQAICargo.DefSQConst(engine, AICargo::CC_PASSENGERS, "CC_PASSENGERS"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
27 |
SQAICargo.DefSQConst(engine, AICargo::CC_MAIL, "CC_MAIL"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
28 |
SQAICargo.DefSQConst(engine, AICargo::CC_EXPRESS, "CC_EXPRESS"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
29 |
SQAICargo.DefSQConst(engine, AICargo::CC_ARMOURED, "CC_ARMOURED"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
30 |
SQAICargo.DefSQConst(engine, AICargo::CC_BULK, "CC_BULK"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
31 |
SQAICargo.DefSQConst(engine, AICargo::CC_PIECE_GOODS, "CC_PIECE_GOODS"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
32 |
SQAICargo.DefSQConst(engine, AICargo::CC_LIQUID, "CC_LIQUID"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
33 |
SQAICargo.DefSQConst(engine, AICargo::CC_REFRIGERATED, "CC_REFRIGERATED"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
34 |
SQAICargo.DefSQConst(engine, AICargo::CC_HAZARDOUS, "CC_HAZARDOUS"); |
|
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
35 |
SQAICargo.DefSQConst(engine, AICargo::CC_COVERED, "CC_COVERED"); |
|
10831
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
36 |
SQAICargo.DefSQConst(engine, AICargo::TE_NONE, "TE_NONE"); |
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
37 |
SQAICargo.DefSQConst(engine, AICargo::TE_PASSENGERS, "TE_PASSENGERS"); |
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
38 |
SQAICargo.DefSQConst(engine, AICargo::TE_MAIL, "TE_MAIL"); |
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
39 |
SQAICargo.DefSQConst(engine, AICargo::TE_GOODS, "TE_GOODS"); |
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
40 |
SQAICargo.DefSQConst(engine, AICargo::TE_WATER, "TE_WATER"); |
|
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
41 |
SQAICargo.DefSQConst(engine, AICargo::TE_FOOD, "TE_FOOD"); |
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
42 |
|
|
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
|
43 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::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
|
44 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::IsValidCargo, "IsValidCargo", 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
|
45 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoLabel, "GetCargoLabel", 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
|
46 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::IsFreight, "IsFreight", 2, "xi"); |
|
10675
b16fdb811ebb
(svn r13219) [NoAI] -Add: added AICargo.HasCargoClass(), which allows you to find, say, passenger-based cargo (tnx kuifware for the pointer!)
truebrain
parents:
10212
diff
changeset
|
47 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::HasCargoClass, "HasCargoClass", 3, "xii"); |
|
10831
f7e17819358b
(svn r13382) [NoAI] -Add: added AICargo::GetTownEffect()
truebrain
parents:
10734
diff
changeset
|
48 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::GetTownEffect, "GetTownEffect", 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
|
49 |
SQAICargo.DefSQStaticMethod(engine, &AICargo::GetCargoIncome, "GetCargoIncome", 4, "xiii"); |
|
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 |
SQAICargo.PostRegister(engine); |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
52 |
} |