author | truebrain |
Sat, 23 Feb 2008 14:42:07 +0000 | |
branch | noai |
changeset 9741 | 53c1c5850e01 |
parent 9710 | ba44f8c1fd52 |
child 9753 | 7209db94ad12 |
permissions | -rw-r--r-- |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
1 |
#include "ai_industrylist_valuator.hpp" |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
2 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
3 |
namespace SQConvert { |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
4 |
/* Allow AIIndustryListProduction to be used as Squirrel parameter */ |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
5 |
template <> AIIndustryListProduction *GetParam(ForceType<AIIndustryListProduction *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListProduction *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
6 |
template <> AIIndustryListProduction &GetParam(ForceType<AIIndustryListProduction &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListProduction *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
7 |
template <> const AIIndustryListProduction *GetParam(ForceType<const AIIndustryListProduction *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListProduction *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
8 |
template <> const AIIndustryListProduction &GetParam(ForceType<const AIIndustryListProduction &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListProduction *)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
|
9 |
template <> int Return<AIIndustryListProduction *>(HSQUIRRELVM vm, AIIndustryListProduction *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryListProduction", res, NULL, DefSQDestructorCallback<AIIndustryListProduction>); return 1; } |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
10 |
}; // namespace SQConvert |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
11 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9710
diff
changeset
|
12 |
void SQAIIndustryListProduction_Register(Squirrel *engine) { |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
13 |
DefSQClass <AIIndustryListProduction> SQAIIndustryListProduction("AIIndustryListProduction"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
14 |
SQAIIndustryListProduction.PreRegister(engine); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
15 |
SQAIIndustryListProduction.AddConstructor<void (AIIndustryListProduction::*)(CargoID cargo_type), 2>(engine, "xi"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
16 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
17 |
SQAIIndustryListProduction.DefSQStaticMethod(engine, &AIIndustryListProduction::GetClassName, "GetClassName", 1, "x"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
18 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
19 |
SQAIIndustryListProduction.PostRegister(engine); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
20 |
} |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
21 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
22 |
namespace SQConvert { |
9710
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
23 |
/* Allow AIIndustryListCargoAccepted to be used as Squirrel parameter */ |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
24 |
template <> AIIndustryListCargoAccepted *GetParam(ForceType<AIIndustryListCargoAccepted *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListCargoAccepted *)instance; } |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
25 |
template <> AIIndustryListCargoAccepted &GetParam(ForceType<AIIndustryListCargoAccepted &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListCargoAccepted *)instance; } |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
26 |
template <> const AIIndustryListCargoAccepted *GetParam(ForceType<const AIIndustryListCargoAccepted *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListCargoAccepted *)instance; } |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
27 |
template <> const AIIndustryListCargoAccepted &GetParam(ForceType<const AIIndustryListCargoAccepted &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListCargoAccepted *)instance; } |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
28 |
template <> int Return<AIIndustryListCargoAccepted *>(HSQUIRRELVM vm, AIIndustryListCargoAccepted *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryListCargoAccepted", res, NULL, DefSQDestructorCallback<AIIndustryListCargoAccepted>); return 1; } |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
29 |
}; // namespace SQConvert |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
30 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9710
diff
changeset
|
31 |
void SQAIIndustryListCargoAccepted_Register(Squirrel *engine) { |
9710
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
32 |
DefSQClass <AIIndustryListCargoAccepted> SQAIIndustryListCargoAccepted("AIIndustryListCargoAccepted"); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
33 |
SQAIIndustryListCargoAccepted.PreRegister(engine); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
34 |
SQAIIndustryListCargoAccepted.AddConstructor<void (AIIndustryListCargoAccepted::*)(CargoID cargo_type), 2>(engine, "xi"); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
35 |
|
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
36 |
SQAIIndustryListCargoAccepted.DefSQStaticMethod(engine, &AIIndustryListCargoAccepted::GetClassName, "GetClassName", 1, "x"); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
37 |
|
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
38 |
SQAIIndustryListCargoAccepted.PostRegister(engine); |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
39 |
} |
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
40 |
|
ba44f8c1fd52
(svn r11294) [NoAI] -Add: added AIIndustry::IsCargoAccepted + Valuator (on request by Kilinich)
truelight
parents:
9680
diff
changeset
|
41 |
namespace SQConvert { |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
42 |
/* Allow AIIndustryListLocation to be used as Squirrel parameter */ |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
43 |
template <> AIIndustryListLocation *GetParam(ForceType<AIIndustryListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListLocation *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
44 |
template <> AIIndustryListLocation &GetParam(ForceType<AIIndustryListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListLocation *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
45 |
template <> const AIIndustryListLocation *GetParam(ForceType<const AIIndustryListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListLocation *)instance; } |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
46 |
template <> const AIIndustryListLocation &GetParam(ForceType<const AIIndustryListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListLocation *)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
|
47 |
template <> int Return<AIIndustryListLocation *>(HSQUIRRELVM vm, AIIndustryListLocation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryListLocation", res, NULL, DefSQDestructorCallback<AIIndustryListLocation>); return 1; } |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
48 |
}; // namespace SQConvert |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
49 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9710
diff
changeset
|
50 |
void SQAIIndustryListLocation_Register(Squirrel *engine) { |
9649
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
51 |
DefSQClass <AIIndustryListLocation> SQAIIndustryListLocation("AIIndustryListLocation"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
52 |
SQAIIndustryListLocation.PreRegister(engine); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
53 |
SQAIIndustryListLocation.AddConstructor<void (AIIndustryListLocation::*)(), 1>(engine, "x"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
54 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
55 |
SQAIIndustryListLocation.DefSQStaticMethod(engine, &AIIndustryListLocation::GetClassName, "GetClassName", 1, "x"); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
56 |
|
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
57 |
SQAIIndustryListLocation.PostRegister(engine); |
bc8c06513f5b
(svn r10544) [NoAI] -Add: added AIIndustryList to list industries
truelight
parents:
diff
changeset
|
58 |
} |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
59 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
60 |
namespace SQConvert { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
61 |
/* Allow AIIndustryListDistanceManhattanToTile to be used as Squirrel parameter */ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
62 |
template <> AIIndustryListDistanceManhattanToTile *GetParam(ForceType<AIIndustryListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListDistanceManhattanToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
63 |
template <> AIIndustryListDistanceManhattanToTile &GetParam(ForceType<AIIndustryListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListDistanceManhattanToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
64 |
template <> const AIIndustryListDistanceManhattanToTile *GetParam(ForceType<const AIIndustryListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListDistanceManhattanToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
65 |
template <> const AIIndustryListDistanceManhattanToTile &GetParam(ForceType<const AIIndustryListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListDistanceManhattanToTile *)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
|
66 |
template <> int Return<AIIndustryListDistanceManhattanToTile *>(HSQUIRRELVM vm, AIIndustryListDistanceManhattanToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryListDistanceManhattanToTile", res, NULL, DefSQDestructorCallback<AIIndustryListDistanceManhattanToTile>); return 1; } |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
67 |
}; // namespace SQConvert |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
68 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9710
diff
changeset
|
69 |
void SQAIIndustryListDistanceManhattanToTile_Register(Squirrel *engine) { |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
70 |
DefSQClass <AIIndustryListDistanceManhattanToTile> SQAIIndustryListDistanceManhattanToTile("AIIndustryListDistanceManhattanToTile"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
71 |
SQAIIndustryListDistanceManhattanToTile.PreRegister(engine); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
72 |
SQAIIndustryListDistanceManhattanToTile.AddConstructor<void (AIIndustryListDistanceManhattanToTile::*)(TileIndex tile), 2>(engine, "xi"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
73 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
74 |
SQAIIndustryListDistanceManhattanToTile.DefSQStaticMethod(engine, &AIIndustryListDistanceManhattanToTile::GetClassName, "GetClassName", 1, "x"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
75 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
76 |
SQAIIndustryListDistanceManhattanToTile.PostRegister(engine); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
77 |
} |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
78 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
79 |
namespace SQConvert { |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
80 |
/* Allow AIIndustryListDistanceSquareToTile to be used as Squirrel parameter */ |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
81 |
template <> AIIndustryListDistanceSquareToTile *GetParam(ForceType<AIIndustryListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListDistanceSquareToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
82 |
template <> AIIndustryListDistanceSquareToTile &GetParam(ForceType<AIIndustryListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListDistanceSquareToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
83 |
template <> const AIIndustryListDistanceSquareToTile *GetParam(ForceType<const AIIndustryListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AIIndustryListDistanceSquareToTile *)instance; } |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
84 |
template <> const AIIndustryListDistanceSquareToTile &GetParam(ForceType<const AIIndustryListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIIndustryListDistanceSquareToTile *)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
|
85 |
template <> int Return<AIIndustryListDistanceSquareToTile *>(HSQUIRRELVM vm, AIIndustryListDistanceSquareToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIIndustryListDistanceSquareToTile", res, NULL, DefSQDestructorCallback<AIIndustryListDistanceSquareToTile>); return 1; } |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
86 |
}; // namespace SQConvert |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
87 |
|
9741
53c1c5850e01
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents:
9710
diff
changeset
|
88 |
void SQAIIndustryListDistanceSquareToTile_Register(Squirrel *engine) { |
9655
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
89 |
DefSQClass <AIIndustryListDistanceSquareToTile> SQAIIndustryListDistanceSquareToTile("AIIndustryListDistanceSquareToTile"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
90 |
SQAIIndustryListDistanceSquareToTile.PreRegister(engine); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
91 |
SQAIIndustryListDistanceSquareToTile.AddConstructor<void (AIIndustryListDistanceSquareToTile::*)(TileIndex tile), 2>(engine, "xi"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
92 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
93 |
SQAIIndustryListDistanceSquareToTile.DefSQStaticMethod(engine, &AIIndustryListDistanceSquareToTile::GetClassName, "GetClassName", 1, "x"); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
94 |
|
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
95 |
SQAIIndustryListDistanceSquareToTile.PostRegister(engine); |
e8e43f333832
(svn r10557) [NoAI] -Add: added for all lists 2 valuators: DistanceManhattanToTile and DistanceSquareToTile, to get the distance from object to some tile you specify
truelight
parents:
9649
diff
changeset
|
96 |
} |