author | truelight |
Wed, 18 Jul 2007 15:09:16 +0000 | |
branch | noai |
changeset 9674 | 15f7b310b6cf |
parent 9673 | ee4f133c84ec |
child 9679 | 788e083db48b |
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; } |
9674
15f7b310b6cf
(svn r10613) [NoAI] -Add r10612: give release-hook for return values of classes for which SQ creates a temporary holder so they are free'd when SQ does
truelight
parents:
9673
diff
changeset
|
9 |
template <> int Return<AITownListRandomize *>(HSQUIRRELVM vm, AITownListRandomize *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AITownListRandomize", res, &instance, DefSQDestructorCallback<AITownListRandomize>); sq_pushobject(vm, instance); 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 |
|
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
|
12 |
void SQAITownListRandomizeRegister(Squirrel *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
|
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; } |
9674
15f7b310b6cf
(svn r10613) [NoAI] -Add r10612: give release-hook for return values of classes for which SQ creates a temporary holder so they are free'd when SQ does
truelight
parents:
9673
diff
changeset
|
28 |
template <> int Return<AITownListPopulation *>(HSQUIRRELVM vm, AITownListPopulation *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AITownListPopulation", res, &instance, DefSQDestructorCallback<AITownListPopulation>); sq_pushobject(vm, instance); 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 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
31 |
void SQAITownListPopulationRegister(Squirrel *engine) { |
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; } |
9674
15f7b310b6cf
(svn r10613) [NoAI] -Add r10612: give release-hook for return values of classes for which SQ creates a temporary holder so they are free'd when SQ does
truelight
parents:
9673
diff
changeset
|
47 |
template <> int Return<AITownListLocation *>(HSQUIRRELVM vm, AITownListLocation *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AITownListLocation", res, &instance, DefSQDestructorCallback<AITownListLocation>); sq_pushobject(vm, instance); 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 |
|
9616
ca607e3077dd
(svn r9783) [NoAI] -Fix: make naming more consistent between Valuators: don't add Get before them.
truelight
parents:
9610
diff
changeset
|
50 |
void SQAITownListLocationRegister(Squirrel *engine) { |
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; } |
9674
15f7b310b6cf
(svn r10613) [NoAI] -Add r10612: give release-hook for return values of classes for which SQ creates a temporary holder so they are free'd when SQ does
truelight
parents:
9673
diff
changeset
|
66 |
template <> int Return<AITownListDistanceManhattanToTile *>(HSQUIRRELVM vm, AITownListDistanceManhattanToTile *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AITownListDistanceManhattanToTile", res, &instance, DefSQDestructorCallback<AITownListDistanceManhattanToTile>); sq_pushobject(vm, instance); 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 |
|
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
|
69 |
void SQAITownListDistanceManhattanToTileRegister(Squirrel *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
|
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; } |
9674
15f7b310b6cf
(svn r10613) [NoAI] -Add r10612: give release-hook for return values of classes for which SQ creates a temporary holder so they are free'd when SQ does
truelight
parents:
9673
diff
changeset
|
85 |
template <> int Return<AITownListDistanceSquareToTile *>(HSQUIRRELVM vm, AITownListDistanceSquareToTile *res) { HSQOBJECT instance; Squirrel::CreateClassInstanceVM(vm, "AITownListDistanceSquareToTile", res, &instance, DefSQDestructorCallback<AITownListDistanceSquareToTile>); sq_pushobject(vm, instance); 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 |
|
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
|
88 |
void SQAITownListDistanceSquareToTileRegister(Squirrel *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
|
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 |
} |