src/ai/api/ai_road.hpp.sq
author truebrain
Tue, 27 May 2008 09:52:05 +0000
branchnoai
changeset 10734 06f95974ac15
parent 10722 6ea1daff57aa
child 10993 203b90795f80
permissions -rw-r--r--
(svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
10212
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 10094
diff changeset
     1
/* $Id$ */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 10094
diff changeset
     2
/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */
1e0a2a182253 (svn r12744) [NoAI] -Fix: added a comment to all .hpp.sq that those files are autogenerated, and shouldn't be manually altered
truebrain
parents: 10094
diff changeset
     3
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     4
#include "ai_road.hpp"
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     5
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
     6
namespace SQConvert {
10091
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
     7
	/* Allow enums to be used as Squirrel parameters */
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
     8
	template <> AIRoad::ErrorMessages GetParam(ForceType<AIRoad::ErrorMessages>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRoad::ErrorMessages)tmp; }
10091
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
     9
	template <> int Return<AIRoad::ErrorMessages>(HSQUIRRELVM vm, AIRoad::ErrorMessages res) { sq_pushinteger(vm, (int32)res); return 1; }
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    10
	template <> AIRoad::RoadType GetParam(ForceType<AIRoad::RoadType>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQInteger tmp; sq_getinteger(vm, index, &tmp); return (AIRoad::RoadType)tmp; }
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    11
	template <> int Return<AIRoad::RoadType>(HSQUIRRELVM vm, AIRoad::RoadType res) { sq_pushinteger(vm, (int32)res); return 1; }
10091
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    12
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    13
	/* Allow AIRoad to be used as Squirrel parameter */
10734
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    14
	template <> AIRoad *GetParam(ForceType<AIRoad *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIRoad *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    15
	template <> AIRoad &GetParam(ForceType<AIRoad &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIRoad *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    16
	template <> const AIRoad *GetParam(ForceType<const AIRoad *>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return  (AIRoad *)instance; }
06f95974ac15 (svn r13284) [NoAI] -Change r13272: make the auto-free-pointers much more general, so in the future we can use it for other things, and not limited to strings
truebrain
parents: 10722
diff changeset
    17
	template <> const AIRoad &GetParam(ForceType<const AIRoad &>, HSQUIRRELVM vm, int index, SQAutoFreePointers *ptr) { SQUserPointer instance; sq_getinstanceup(vm, index, &instance, 0); return *(AIRoad *)instance; }
9680
5ed7bbfd51c7 (svn r10629) [NoAI] -Fix: on returning a class instance which is NULL, do not make a wrapper SQ, but return a NULL pointer too
truelight
parents: 9679
diff changeset
    18
	template <> int Return<AIRoad *>(HSQUIRRELVM vm, AIRoad *res) { if (res == NULL) { sq_pushnull(vm); return 1; } res->AddRef(); Squirrel::CreateClassInstanceVM(vm, "AIRoad", res, NULL, DefSQDestructorCallback<AIRoad>); return 1; }
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    19
}; // namespace SQConvert
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    20
9741
53c1c5850e01 (svn r12221) [NoAI] -Fix: Register functions are no _Register functions, and always on top of the sort list
truebrain
parents: 9737
diff changeset
    21
void SQAIRoad_Register(Squirrel *engine) {
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    22
	DefSQClass <AIRoad> SQAIRoad("AIRoad");
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    23
	SQAIRoad.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
    24
	SQAIRoad.AddConstructor<void (AIRoad::*)(), 1>(engine, "x");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    25
10091
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    26
	SQAIRoad.DefSQConst(engine, AIRoad::ERR_ROAD_BASE,                                "ERR_ROAD_BASE");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    27
	SQAIRoad.DefSQConst(engine, AIRoad::ERR_ROAD_WORKS_IN_PROGRESS,                   "ERR_ROAD_WORKS_IN_PROGRESS");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    28
	SQAIRoad.DefSQConst(engine, AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION,       "ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    29
	SQAIRoad.DefSQConst(engine, AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD,           "ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    30
	SQAIRoad.DefSQConst(engine, AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, "ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS");
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    31
	SQAIRoad.DefSQConst(engine, AIRoad::ROADTYPE_ROAD,                                "ROADTYPE_ROAD");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    32
	SQAIRoad.DefSQConst(engine, AIRoad::ROADTYPE_TRAM,                                "ROADTYPE_TRAM");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    33
	SQAIRoad.DefSQConst(engine, AIRoad::ROADTYPE_INVALID,                             "ROADTYPE_INVALID");
10091
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    34
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    35
	AIError::RegisterErrorMap(STR_ROAD_WORKS_IN_PROGRESS,               AIRoad::ERR_ROAD_WORKS_IN_PROGRESS);
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    36
	AIError::RegisterErrorMap(STR_DRIVE_THROUGH_ERROR_DIRECTION,        AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION);
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    37
	AIError::RegisterErrorMap(STR_DRIVE_THROUGH_ERROR_ON_TOWN_ROAD,     AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD);
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    38
	AIError::RegisterErrorMap(STR_ERR_ONEWAY_ROADS_CAN_T_HAVE_JUNCTION, AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS);
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    39
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    40
	AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_WORKS_IN_PROGRESS,                   "ERR_ROAD_WORKS_IN_PROGRESS");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    41
	AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION,       "ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    42
	AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD,           "ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    43
	AIError::RegisterErrorMapString(AIRoad::ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS, "ERR_ROAD_ONE_WAY_ROADS_CANNOT_HAVE_JUNCTIONS");
e4feb2f9fedf (svn r12621) [NoAI] -Add: support for GetLastError in AIRoad. Patch by Morloth.
rubidium
parents: 9741
diff changeset
    44
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    45
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetClassName,                  "GetClassName",                  1, "x");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    46
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadTile,                    "IsRoadTile",                    2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    47
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadDepotTile,               "IsRoadDepotTile",               2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    48
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadStationTile,             "IsRoadStationTile",             2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    49
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsDriveThroughRoadStationTile, "IsDriveThroughRoadStationTile", 2, "xi");
10668
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    50
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::IsRoadTypeAvailable,           "IsRoadTypeAvailable",           2, "xi");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    51
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetCurrentRoadType,            "GetCurrentRoadType",            1, "x");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    52
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::SetCurrentRoadType,            "SetCurrentRoadType",            2, "xi");
495789401303 (svn r13212) [NoAI] -Add: introducing the ability to build trams. Use AIRoad.SetCurrentRoadType to switch to Trams, than all AIRoad functions will produce tram-objects.
truebrain
parents: 10212
diff changeset
    53
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::HasRoadType,                   "HasRoadType",                   3, "xii");
9737
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    54
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::AreRoadTilesConnected,         "AreRoadTilesConnected",         3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    55
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetNeighbourRoadCount,         "GetNeighbourRoadCount",         2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    56
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetRoadDepotFrontTile,         "GetRoadDepotFrontTile",         2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    57
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetRoadStationFrontTile,       "GetRoadStationFrontTile",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    58
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::GetDriveThroughBackTile,       "GetDriveThroughBackTile",       2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    59
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::BuildRoad,                     "BuildRoad",                     3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    60
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::BuildRoadFull,                 "BuildRoadFull",                 3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    61
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::BuildRoadDepot,                "BuildRoadDepot",                3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    62
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::BuildRoadStation,              "BuildRoadStation",              5, "xiibb");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    63
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoad,                    "RemoveRoad",                    3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    64
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadFull,                "RemoveRoadFull",                3, "xii");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    65
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadDepot,               "RemoveRoadDepot",               2, "xi");
ee408edf3851 (svn r12216) [NoAI] -Codechange: made most functions 'static', which removes the need to create an instance to get, for example, engine information, and therefor heavily simplifying AI creation (Morloth)
truebrain
parents: 9680
diff changeset
    66
	SQAIRoad.DefSQStaticMethod(engine, &AIRoad::RemoveRoadStation,             "RemoveRoadStation",             2, "xi");
9596
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    67
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    68
	SQAIRoad.PostRegister(engine);
8af5a1399842 (svn r9629) [NoAI] -Codechange: move the squirrel export functions out of the API header files.
rubidium
parents:
diff changeset
    69
}