src/ai/api/ai_tilelist_valuator.hpp.sq
author truebrain
Sat, 23 Feb 2008 14:42:07 +0000
branchnoai
changeset 9741 53c1c5850e01
parent 9700 e442ce398e83
child 9753 7209db94ad12
permissions -rw-r--r--
(svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     1
#include "ai_tilelist_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 {
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     4
	/* Allow AITileListBuildable to be used as Squirrel parameter */
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     5
	template <> AITileListBuildable *GetParam(ForceType<AITileListBuildable *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListBuildable *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     6
	template <> AITileListBuildable &GetParam(ForceType<AITileListBuildable &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListBuildable *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     7
	template <> const AITileListBuildable *GetParam(ForceType<const AITileListBuildable *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListBuildable *)instance; }
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     8
	template <> const AITileListBuildable &GetParam(ForceType<const AITileListBuildable &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListBuildable *)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<AITileListBuildable *>(HSQUIRRELVM vm, AITileListBuildable *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListBuildable", res, NULL, DefSQDestructorCallback<AITileListBuildable>); return 1; }
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    10
}; // namespace SQConvert
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
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: 9700
diff changeset
    12
void SQAITileListBuildable_Register(Squirrel *engine) {
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    13
	DefSQClass <AITileListBuildable> SQAITileListBuildable("AITileListBuildable");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    14
	SQAITileListBuildable.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: 9617
diff changeset
    15
	SQAITileListBuildable.AddConstructor<void (AITileListBuildable::*)(), 1>(engine, "x");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    16
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    17
	SQAITileListBuildable.DefSQStaticMethod(engine, &AITileListBuildable::GetClassName, "GetClassName", 1, "x");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    18
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    19
	SQAITileListBuildable.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    20
}
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    21
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
    22
namespace SQConvert {
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    23
	/* Allow AITileListWater to be used as Squirrel parameter */
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    24
	template <> AITileListWater *GetParam(ForceType<AITileListWater *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListWater *)instance; }
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    25
	template <> AITileListWater &GetParam(ForceType<AITileListWater &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListWater *)instance; }
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    26
	template <> const AITileListWater *GetParam(ForceType<const AITileListWater *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListWater *)instance; }
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    27
	template <> const AITileListWater &GetParam(ForceType<const AITileListWater &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListWater *)instance; }
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    28
	template <> int Return<AITileListWater *>(HSQUIRRELVM vm, AITileListWater *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListWater", res, NULL, DefSQDestructorCallback<AITileListWater>); return 1; }
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    29
}; // namespace SQConvert
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
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: 9700
diff changeset
    31
void SQAITileListWater_Register(Squirrel *engine) {
9698
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    32
	DefSQClass <AITileListWater> SQAITileListWater("AITileListWater");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    33
	SQAITileListWater.PreRegister(engine);
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    34
	SQAITileListWater.AddConstructor<void (AITileListWater::*)(), 1>(engine, "x");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    35
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    36
	SQAITileListWater.DefSQStaticMethod(engine, &AITileListWater::GetClassName, "GetClassName", 1, "x");
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    37
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    38
	SQAITileListWater.PostRegister(engine);
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    39
}
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    40
1d50fe99b7e9 (svn r10939) [NoAI] -Add: added AITileList valuator Water
truelight
parents: 9680
diff changeset
    41
namespace SQConvert {
9657
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    42
	/* Allow AITileListBuildableRectangle to be used as Squirrel parameter */
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    43
	template <> AITileListBuildableRectangle *GetParam(ForceType<AITileListBuildableRectangle *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListBuildableRectangle *)instance; }
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    44
	template <> AITileListBuildableRectangle &GetParam(ForceType<AITileListBuildableRectangle &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListBuildableRectangle *)instance; }
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    45
	template <> const AITileListBuildableRectangle *GetParam(ForceType<const AITileListBuildableRectangle *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListBuildableRectangle *)instance; }
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    46
	template <> const AITileListBuildableRectangle &GetParam(ForceType<const AITileListBuildableRectangle &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListBuildableRectangle *)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<AITileListBuildableRectangle *>(HSQUIRRELVM vm, AITileListBuildableRectangle *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListBuildableRectangle", res, NULL, DefSQDestructorCallback<AITileListBuildableRectangle>); return 1; }
9657
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    48
}; // namespace SQConvert
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
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: 9700
diff changeset
    50
void SQAITileListBuildableRectangle_Register(Squirrel *engine) {
9657
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    51
	DefSQClass <AITileListBuildableRectangle> SQAITileListBuildableRectangle("AITileListBuildableRectangle");
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    52
	SQAITileListBuildableRectangle.PreRegister(engine);
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    53
	SQAITileListBuildableRectangle.AddConstructor<void (AITileListBuildableRectangle::*)(uint width, uint height), 3>(engine, "xii");
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    54
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    55
	SQAITileListBuildableRectangle.DefSQStaticMethod(engine, &AITileListBuildableRectangle::GetClassName, "GetClassName", 1, "x");
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    56
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    57
	SQAITileListBuildableRectangle.PostRegister(engine);
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    58
}
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    59
f2c6e332d8bc (svn r10564) [NoAI] -Add: added a AITileList valuator that checks for a NxM buildable spot with the entry from the AITileList as top-left tile
truelight
parents: 9655
diff changeset
    60
namespace SQConvert {
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    61
	/* Allow AITileListSlope to be used as Squirrel parameter */
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    62
	template <> AITileListSlope *GetParam(ForceType<AITileListSlope *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListSlope *)instance; }
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    63
	template <> AITileListSlope &GetParam(ForceType<AITileListSlope &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListSlope *)instance; }
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    64
	template <> const AITileListSlope *GetParam(ForceType<const AITileListSlope *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListSlope *)instance; }
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    65
	template <> const AITileListSlope &GetParam(ForceType<const AITileListSlope &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListSlope *)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<AITileListSlope *>(HSQUIRRELVM vm, AITileListSlope *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListSlope", res, NULL, DefSQDestructorCallback<AITileListSlope>); return 1; }
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    67
}; // namespace SQConvert
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
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: 9700
diff changeset
    69
void SQAITileListSlope_Register(Squirrel *engine) {
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    70
	DefSQClass <AITileListSlope> SQAITileListSlope("AITileListSlope");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    71
	SQAITileListSlope.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: 9617
diff changeset
    72
	SQAITileListSlope.AddConstructor<void (AITileListSlope::*)(), 1>(engine, "x");
9611
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    73
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    74
	SQAITileListSlope.DefSQStaticMethod(engine, &AITileListSlope::GetClassName, "GetClassName", 1, "x");
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    75
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    76
	SQAITileListSlope.PostRegister(engine);
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    77
}
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    78
5cf58c6571b7 (svn r9776) [NoAI] -Add: added AITileListSlope as valuator to see if tiles are flat or not
truelight
parents: 9610
diff changeset
    79
namespace SQConvert {
9700
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    80
	/* Allow AITileListHeight to be used as Squirrel parameter */
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    81
	template <> AITileListHeight *GetParam(ForceType<AITileListHeight *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListHeight *)instance; }
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    82
	template <> AITileListHeight &GetParam(ForceType<AITileListHeight &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListHeight *)instance; }
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    83
	template <> const AITileListHeight *GetParam(ForceType<const AITileListHeight *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListHeight *)instance; }
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    84
	template <> const AITileListHeight &GetParam(ForceType<const AITileListHeight &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListHeight *)instance; }
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    85
	template <> int Return<AITileListHeight *>(HSQUIRRELVM vm, AITileListHeight *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListHeight", res, NULL, DefSQDestructorCallback<AITileListHeight>); return 1; }
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    86
}; // namespace SQConvert
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
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: 9700
diff changeset
    88
void SQAITileListHeight_Register(Squirrel *engine) {
9700
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    89
	DefSQClass <AITileListHeight> SQAITileListHeight("AITileListHeight");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    90
	SQAITileListHeight.PreRegister(engine);
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    91
	SQAITileListHeight.AddConstructor<void (AITileListHeight::*)(), 1>(engine, "x");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    92
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    93
	SQAITileListHeight.DefSQStaticMethod(engine, &AITileListHeight::GetClassName, "GetClassName", 1, "x");
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    94
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    95
	SQAITileListHeight.PostRegister(engine);
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    96
}
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    97
e442ce398e83 (svn r10941) [NoAI] -Add: added AITile::GetHeight and AITileList valuator Height
truelight
parents: 9698
diff changeset
    98
namespace SQConvert {
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
    99
	/* Allow AITileListNeighbourRoadCount to be used as Squirrel parameter */
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   100
	template <> AITileListNeighbourRoadCount *GetParam(ForceType<AITileListNeighbourRoadCount *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListNeighbourRoadCount *)instance; }
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   101
	template <> AITileListNeighbourRoadCount &GetParam(ForceType<AITileListNeighbourRoadCount &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListNeighbourRoadCount *)instance; }
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   102
	template <> const AITileListNeighbourRoadCount *GetParam(ForceType<const AITileListNeighbourRoadCount *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListNeighbourRoadCount *)instance; }
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   103
	template <> const AITileListNeighbourRoadCount &GetParam(ForceType<const AITileListNeighbourRoadCount &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListNeighbourRoadCount *)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
   104
	template <> int Return<AITileListNeighbourRoadCount *>(HSQUIRRELVM vm, AITileListNeighbourRoadCount *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListNeighbourRoadCount", res, NULL, DefSQDestructorCallback<AITileListNeighbourRoadCount>); return 1; }
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   105
}; // namespace SQConvert
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   106
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9700
diff changeset
   107
void SQAITileListNeighbourRoadCount_Register(Squirrel *engine) {
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   108
	DefSQClass <AITileListNeighbourRoadCount> SQAITileListNeighbourRoadCount("AITileListNeighbourRoadCount");
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   109
	SQAITileListNeighbourRoadCount.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: 9617
diff changeset
   110
	SQAITileListNeighbourRoadCount.AddConstructor<void (AITileListNeighbourRoadCount::*)(), 1>(engine, "x");
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   111
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   112
	SQAITileListNeighbourRoadCount.DefSQStaticMethod(engine, &AITileListNeighbourRoadCount::GetClassName, "GetClassName", 1, "x");
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   113
9617
df9cedf12aab (svn r9786) [NoAI] -Fix: NeighbourRoad -> NeighbourRoadCount
truelight
parents: 9611
diff changeset
   114
	SQAITileListNeighbourRoadCount.PostRegister(engine);
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   115
}
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   116
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   117
namespace SQConvert {
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   118
	/* Allow AITileListRoadTile to be used as Squirrel parameter */
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   119
	template <> AITileListRoadTile *GetParam(ForceType<AITileListRoadTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListRoadTile *)instance; }
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   120
	template <> AITileListRoadTile &GetParam(ForceType<AITileListRoadTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListRoadTile *)instance; }
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   121
	template <> const AITileListRoadTile *GetParam(ForceType<const AITileListRoadTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListRoadTile *)instance; }
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   122
	template <> const AITileListRoadTile &GetParam(ForceType<const AITileListRoadTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListRoadTile *)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
   123
	template <> int Return<AITileListRoadTile *>(HSQUIRRELVM vm, AITileListRoadTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListRoadTile", res, NULL, DefSQDestructorCallback<AITileListRoadTile>); return 1; }
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   124
}; // namespace SQConvert
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   125
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9700
diff changeset
   126
void SQAITileListRoadTile_Register(Squirrel *engine) {
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   127
	DefSQClass <AITileListRoadTile> SQAITileListRoadTile("AITileListRoadTile");
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   128
	SQAITileListRoadTile.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: 9617
diff changeset
   129
	SQAITileListRoadTile.AddConstructor<void (AITileListRoadTile::*)(), 1>(engine, "x");
9603
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   130
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   131
	SQAITileListRoadTile.DefSQStaticMethod(engine, &AITileListRoadTile::GetClassName, "GetClassName", 1, "x");
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   132
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   133
	SQAITileListRoadTile.PostRegister(engine);
49323bf80ebd (svn r9747) [NoAI] -Add: added AITileListRoadTile and AITileListNeighbourRoad as Valuators for AITileList
truelight
parents: 9596
diff changeset
   134
}
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   135
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   136
namespace SQConvert {
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   137
	/* Allow AITileListCargoAcceptance to be used as Squirrel parameter */
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   138
	template <> AITileListCargoAcceptance *GetParam(ForceType<AITileListCargoAcceptance *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListCargoAcceptance *)instance; }
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   139
	template <> AITileListCargoAcceptance &GetParam(ForceType<AITileListCargoAcceptance &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListCargoAcceptance *)instance; }
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   140
	template <> const AITileListCargoAcceptance *GetParam(ForceType<const AITileListCargoAcceptance *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListCargoAcceptance *)instance; }
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   141
	template <> const AITileListCargoAcceptance &GetParam(ForceType<const AITileListCargoAcceptance &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListCargoAcceptance *)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
   142
	template <> int Return<AITileListCargoAcceptance *>(HSQUIRRELVM vm, AITileListCargoAcceptance *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListCargoAcceptance", res, NULL, DefSQDestructorCallback<AITileListCargoAcceptance>); return 1; }
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   143
}; // namespace SQConvert
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   144
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9700
diff changeset
   145
void SQAITileListCargoAcceptance_Register(Squirrel *engine) {
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   146
	DefSQClass <AITileListCargoAcceptance> SQAITileListCargoAcceptance("AITileListCargoAcceptance");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   147
	SQAITileListCargoAcceptance.PreRegister(engine);
9658
e7675771bca4 (svn r10565) [NoAI] -Add: allow giving width, height and radius to check for cargo acceptance
truelight
parents: 9657
diff changeset
   148
	SQAITileListCargoAcceptance.AddConstructor<void (AITileListCargoAcceptance::*)(CargoID cargo_type, uint width, uint height, uint radius), 5>(engine, "xiiii");
9609
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   149
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   150
	SQAITileListCargoAcceptance.DefSQStaticMethod(engine, &AITileListCargoAcceptance::GetClassName, "GetClassName", 1, "x");
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   151
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   152
	SQAITileListCargoAcceptance.PostRegister(engine);
f0dbf5850145 (svn r9767) [NoAI] -Add: add support for params in the constructor (via C++ templates)
truelight
parents: 9603
diff changeset
   153
}
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
   154
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
   155
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
   156
	/* Allow AITileListDistanceManhattanToTile 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
   157
	template <> AITileListDistanceManhattanToTile *GetParam(ForceType<AITileListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListDistanceManhattanToTile *)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
   158
	template <> AITileListDistanceManhattanToTile &GetParam(ForceType<AITileListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListDistanceManhattanToTile *)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
   159
	template <> const AITileListDistanceManhattanToTile *GetParam(ForceType<const AITileListDistanceManhattanToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListDistanceManhattanToTile *)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
   160
	template <> const AITileListDistanceManhattanToTile &GetParam(ForceType<const AITileListDistanceManhattanToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListDistanceManhattanToTile *)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
   161
	template <> int Return<AITileListDistanceManhattanToTile *>(HSQUIRRELVM vm, AITileListDistanceManhattanToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListDistanceManhattanToTile", res, NULL, DefSQDestructorCallback<AITileListDistanceManhattanToTile>); 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
   162
}; // 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
   163
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9700
diff changeset
   164
void SQAITileListDistanceManhattanToTile_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
   165
	DefSQClass <AITileListDistanceManhattanToTile> SQAITileListDistanceManhattanToTile("AITileListDistanceManhattanToTile");
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
   166
	SQAITileListDistanceManhattanToTile.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
   167
	SQAITileListDistanceManhattanToTile.AddConstructor<void (AITileListDistanceManhattanToTile::*)(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
   168
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
   169
	SQAITileListDistanceManhattanToTile.DefSQStaticMethod(engine, &AITileListDistanceManhattanToTile::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
   170
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
   171
	SQAITileListDistanceManhattanToTile.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
   172
}
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
   173
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
   174
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
   175
	/* Allow AITileListDistanceSquareToTile 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
   176
	template <> AITileListDistanceSquareToTile *GetParam(ForceType<AITileListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListDistanceSquareToTile *)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
   177
	template <> AITileListDistanceSquareToTile &GetParam(ForceType<AITileListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListDistanceSquareToTile *)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
   178
	template <> const AITileListDistanceSquareToTile *GetParam(ForceType<const AITileListDistanceSquareToTile *>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AITileListDistanceSquareToTile *)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
   179
	template <> const AITileListDistanceSquareToTile &GetParam(ForceType<const AITileListDistanceSquareToTile &>, HSQUIRRELVM vm, int index) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AITileListDistanceSquareToTile *)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
   180
	template <> int Return<AITileListDistanceSquareToTile *>(HSQUIRRELVM vm, AITileListDistanceSquareToTile *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AITileListDistanceSquareToTile", res, NULL, DefSQDestructorCallback<AITileListDistanceSquareToTile>); 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
   181
}; // 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
   182
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9700
diff changeset
   183
void SQAITileListDistanceSquareToTile_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
   184
	DefSQClass <AITileListDistanceSquareToTile> SQAITileListDistanceSquareToTile("AITileListDistanceSquareToTile");
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
   185
	SQAITileListDistanceSquareToTile.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
   186
	SQAITileListDistanceSquareToTile.AddConstructor<void (AITileListDistanceSquareToTile::*)(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
   187
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
   188
	SQAITileListDistanceSquareToTile.DefSQStaticMethod(engine, &AITileListDistanceSquareToTile::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
   189
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
   190
	SQAITileListDistanceSquareToTile.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
   191
}