author | truebrain |
Sat, 23 Feb 2008 14:42:07 +0000 | |
branch | noai |
changeset 9741 | 53c1c5850e01 |
parent 9680 | 5ed7bbfd51c7 |
child 9753 | 7209db94ad12 |
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_townlist_valuator.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 { |
9660
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
4 |
/* Allow AITownListRandomize to be used as Squirrel parameter */ |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
5 |
template <> AITownListRandomize *GetParam(ForceType<AITownListRandomize *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListRandomize *)instance; } |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
6 |
template <> AITownListRandomize &GetParam(ForceType<AITownListRandomize &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListRandomize *)instance; } |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
7 |
template <> const AITownListRandomize *GetParam(ForceType<const AITownListRandomize *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListRandomize *)instance; } |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
8 |
template <> const AITownListRandomize &GetParam(ForceType<const AITownListRandomize &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListRandomize *)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<AITownListRandomize *>(HSQUIRRELVM vm, AITownListRandomize *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownListRandomize", res, NULL, DefSQDestructorCallback<AITownListRandomize>); return 1; } |
9660
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
10 |
}; // namespace SQConvert |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
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:
9680
diff
changeset
|
12 |
void SQAITownListRandomize_Register(Squirrel *engine) { |
9660
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
13 |
DefSQClass <AITownListRandomize> SQAITownListRandomize("AITownListRandomize"); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
14 |
SQAITownListRandomize.PreRegister(engine); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
15 |
SQAITownListRandomize.AddConstructor<void (AITownListRandomize::*)(), 1>(engine, "x"); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
16 |
|
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
17 |
SQAITownListRandomize.DefSQStaticMethod(engine, &AITownListRandomize::GetClassName, "GetClassName", 1, "x"); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
18 |
|
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
19 |
SQAITownListRandomize.PostRegister(engine); |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
20 |
} |
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
21 |
|
d0a430e8310b
(svn r10569) [NoAI] -Add: added AIListRandomize as Valuator for all lists to attach a random value to all items
truelight
parents:
9655
diff
changeset
|
22 |
namespace SQConvert { |
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
23 |
/* Allow AITownListPopulation to be used as Squirrel parameter */ |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
24 |
template <> AITownListPopulation *GetParam(ForceType<AITownListPopulation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListPopulation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
25 |
template <> AITownListPopulation &GetParam(ForceType<AITownListPopulation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListPopulation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
26 |
template <> const AITownListPopulation *GetParam(ForceType<const AITownListPopulation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListPopulation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
27 |
template <> const AITownListPopulation &GetParam(ForceType<const AITownListPopulation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListPopulation *)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
|
28 |
template <> int Return<AITownListPopulation *>(HSQUIRRELVM vm, AITownListPopulation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownListPopulation", res, NULL, DefSQDestructorCallback<AITownListPopulation>); return 1; } |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
29 |
}; // namespace SQConvert |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
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:
9680
diff
changeset
|
31 |
void SQAITownListPopulation_Register(Squirrel *engine) { |
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
32 |
DefSQClass <AITownListPopulation> SQAITownListPopulation("AITownListPopulation"); |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
33 |
SQAITownListPopulation.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:
9616
diff
changeset
|
34 |
SQAITownListPopulation.AddConstructor<void (AITownListPopulation::*)(), 1>(engine, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
35 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
36 |
SQAITownListPopulation.DefSQStaticMethod(engine, &AITownListPopulation::GetClassName, "GetClassName", 1, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
37 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
38 |
SQAITownListPopulation.PostRegister(engine); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
39 |
} |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
40 |
|
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
41 |
namespace SQConvert { |
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
42 |
/* Allow AITownListLocation to be used as Squirrel parameter */ |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
43 |
template <> AITownListLocation *GetParam(ForceType<AITownListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListLocation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
44 |
template <> AITownListLocation &GetParam(ForceType<AITownListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListLocation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
45 |
template <> const AITownListLocation *GetParam(ForceType<const AITownListLocation *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListLocation *)instance; } |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
46 |
template <> const AITownListLocation &GetParam(ForceType<const AITownListLocation &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListLocation *)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<AITownListLocation *>(HSQUIRRELVM vm, AITownListLocation *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownListLocation", res, NULL, DefSQDestructorCallback<AITownListLocation>); return 1; } |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
48 |
}; // namespace SQConvert |
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
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:
9680
diff
changeset
|
50 |
void SQAITownListLocation_Register(Squirrel *engine) { |
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
51 |
DefSQClass <AITownListLocation> SQAITownListLocation("AITownListLocation"); |
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
52 |
SQAITownListLocation.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:
9616
diff
changeset
|
53 |
SQAITownListLocation.AddConstructor<void (AITownListLocation::*)(), 1>(engine, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
54 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
55 |
SQAITownListLocation.DefSQStaticMethod(engine, &AITownListLocation::GetClassName, "GetClassName", 1, "x"); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff
changeset
|
56 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
57 |
SQAITownListLocation.PostRegister(engine); |
9596
8af5a1399842
(svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
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:
9635
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:
9635
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:
9635
diff
changeset
|
61 |
/* Allow AITownListDistanceManhattanToTile 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:
9635
diff
changeset
|
62 |
template <> AITownListDistanceManhattanToTile *GetParam(ForceType<AITownListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListDistanceManhattanToTile *)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:
9635
diff
changeset
|
63 |
template <> AITownListDistanceManhattanToTile &GetParam(ForceType<AITownListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListDistanceManhattanToTile *)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:
9635
diff
changeset
|
64 |
template <> const AITownListDistanceManhattanToTile *GetParam(ForceType<const AITownListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListDistanceManhattanToTile *)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:
9635
diff
changeset
|
65 |
template <> const AITownListDistanceManhattanToTile &GetParam(ForceType<const AITownListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListDistanceManhattanToTile *)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<AITownListDistanceManhattanToTile *>(HSQUIRRELVM vm, AITownListDistanceManhattanToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownListDistanceManhattanToTile", res, NULL, DefSQDestructorCallback<AITownListDistanceManhattanToTile>); 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:
9635
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:
9635
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:
9680
diff
changeset
|
69 |
void SQAITownListDistanceManhattanToTile_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:
9635
diff
changeset
|
70 |
DefSQClass <AITownListDistanceManhattanToTile> SQAITownListDistanceManhattanToTile("AITownListDistanceManhattanToTile"); |
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:
9635
diff
changeset
|
71 |
SQAITownListDistanceManhattanToTile.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:
9635
diff
changeset
|
72 |
SQAITownListDistanceManhattanToTile.AddConstructor<void (AITownListDistanceManhattanToTile::*)(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:
9635
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:
9635
diff
changeset
|
74 |
SQAITownListDistanceManhattanToTile.DefSQStaticMethod(engine, &AITownListDistanceManhattanToTile::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:
9635
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:
9635
diff
changeset
|
76 |
SQAITownListDistanceManhattanToTile.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:
9635
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:
9635
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:
9635
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:
9635
diff
changeset
|
80 |
/* Allow AITownListDistanceSquareToTile 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:
9635
diff
changeset
|
81 |
template <> AITownListDistanceSquareToTile *GetParam(ForceType<AITownListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListDistanceSquareToTile *)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:
9635
diff
changeset
|
82 |
template <> AITownListDistanceSquareToTile &GetParam(ForceType<AITownListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListDistanceSquareToTile *)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:
9635
diff
changeset
|
83 |
template <> const AITownListDistanceSquareToTile *GetParam(ForceType<const AITownListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return (AITownListDistanceSquareToTile *)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:
9635
diff
changeset
|
84 |
template <> const AITownListDistanceSquareToTile &GetParam(ForceType<const AITownListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITownListDistanceSquareToTile *)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<AITownListDistanceSquareToTile *>(HSQUIRRELVM vm, AITownListDistanceSquareToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITownListDistanceSquareToTile", res, NULL, DefSQDestructorCallback<AITownListDistanceSquareToTile>); 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:
9635
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:
9635
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:
9680
diff
changeset
|
88 |
void SQAITownListDistanceSquareToTile_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:
9635
diff
changeset
|
89 |
DefSQClass <AITownListDistanceSquareToTile> SQAITownListDistanceSquareToTile("AITownListDistanceSquareToTile"); |
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:
9635
diff
changeset
|
90 |
SQAITownListDistanceSquareToTile.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:
9635
diff
changeset
|
91 |
SQAITownListDistanceSquareToTile.AddConstructor<void (AITownListDistanceSquareToTile::*)(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:
9635
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:
9635
diff
changeset
|
93 |
SQAITownListDistanceSquareToTile.DefSQStaticMethod(engine, &AITownListDistanceSquareToTile::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:
9635
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:
9635
diff
changeset
|
95 |
SQAITownListDistanceSquareToTile.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:
9635
diff
changeset
|
96 |
} |