summaryrefslogtreecommitdiff
path: root/src/script/api/game/game_rail.hpp.sq
blob: c05736030014766867a14ff5ea307a4b0ef5ed03 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* $Id$ */

/*
 * This file is part of OpenTTD.
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 */

/* THIS FILE IS AUTO-GENERATED; PLEASE DO NOT ALTER MANUALLY */

#include "../script_rail.hpp"
#include "../template/template_rail.hpp.sq"


template <> const char *GetClassName<ScriptRail, ST_GS>() { return "GSRail"; }

void SQGSRail_Register(Squirrel *engine)
{
	DefSQClass<ScriptRail, ST_GS> SQGSRail("GSRail");
	SQGSRail.PreRegister(engine);
	SQGSRail.AddConstructor<void (ScriptRail::*)(), 1>(engine, "x");

	SQGSRail.DefSQConst(engine, ScriptRail::ERR_RAIL_BASE,                   "ERR_RAIL_BASE");
	SQGSRail.DefSQConst(engine, ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD,     "ERR_CROSSING_ON_ONEWAY_ROAD");
	SQGSRail.DefSQConst(engine, ScriptRail::ERR_UNSUITABLE_TRACK,            "ERR_UNSUITABLE_TRACK");
	SQGSRail.DefSQConst(engine, ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTYPE_INVALID,                "RAILTYPE_INVALID");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_NE_SW,                 "RAILTRACK_NE_SW");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_NW_SE,                 "RAILTRACK_NW_SE");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_NW_NE,                 "RAILTRACK_NW_NE");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_SW_SE,                 "RAILTRACK_SW_SE");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_NW_SW,                 "RAILTRACK_NW_SW");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_NE_SE,                 "RAILTRACK_NE_SE");
	SQGSRail.DefSQConst(engine, ScriptRail::RAILTRACK_INVALID,               "RAILTRACK_INVALID");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_NORMAL,               "SIGNALTYPE_NORMAL");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_ENTRY,                "SIGNALTYPE_ENTRY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_EXIT,                 "SIGNALTYPE_EXIT");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_COMBO,                "SIGNALTYPE_COMBO");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_PBS,                  "SIGNALTYPE_PBS");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_PBS_ONEWAY,           "SIGNALTYPE_PBS_ONEWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_TWOWAY,               "SIGNALTYPE_TWOWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_NORMAL_TWOWAY,        "SIGNALTYPE_NORMAL_TWOWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_ENTRY_TWOWAY,         "SIGNALTYPE_ENTRY_TWOWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_EXIT_TWOWAY,          "SIGNALTYPE_EXIT_TWOWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_COMBO_TWOWAY,         "SIGNALTYPE_COMBO_TWOWAY");
	SQGSRail.DefSQConst(engine, ScriptRail::SIGNALTYPE_NONE,                 "SIGNALTYPE_NONE");
	SQGSRail.DefSQConst(engine, ScriptRail::BT_TRACK,                        "BT_TRACK");
	SQGSRail.DefSQConst(engine, ScriptRail::BT_SIGNAL,                       "BT_SIGNAL");
	SQGSRail.DefSQConst(engine, ScriptRail::BT_DEPOT,                        "BT_DEPOT");
	SQGSRail.DefSQConst(engine, ScriptRail::BT_STATION,                      "BT_STATION");
	SQGSRail.DefSQConst(engine, ScriptRail::BT_WAYPOINT,                     "BT_WAYPOINT");

	ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_ON_ONEWAY_ROAD,    ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD);
	ScriptError::RegisterErrorMap(STR_ERROR_NO_SUITABLE_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
	ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_RAILROAD_TRACK, ScriptRail::ERR_UNSUITABLE_TRACK);
	ScriptError::RegisterErrorMap(STR_ERROR_THERE_ARE_NO_SIGNALS,       ScriptRail::ERR_UNSUITABLE_TRACK);
	ScriptError::RegisterErrorMap(STR_ERROR_THERE_IS_NO_STATION,        ScriptRail::ERR_UNSUITABLE_TRACK);
	ScriptError::RegisterErrorMap(STR_ERROR_CROSSING_DISALLOWED,        ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING);

	ScriptError::RegisterErrorMapString(ScriptRail::ERR_CROSSING_ON_ONEWAY_ROAD,     "ERR_CROSSING_ON_ONEWAY_ROAD");
	ScriptError::RegisterErrorMapString(ScriptRail::ERR_UNSUITABLE_TRACK,            "ERR_UNSUITABLE_TRACK");
	ScriptError::RegisterErrorMapString(ScriptRail::ERR_RAILTYPE_DISALLOWS_CROSSING, "ERR_RAILTYPE_DISALLOWS_CROSSING");

	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetName,                         "GetName",                         2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTile,                      "IsRailTile",                      2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsLevelCrossingTile,             "IsLevelCrossingTile",             2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailDepotTile,                 "IsRailDepotTile",                 2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailStationTile,               "IsRailStationTile",               2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailWaypointTile,              "IsRailWaypointTile",              2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::IsRailTypeAvailable,             "IsRailTypeAvailable",             2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetCurrentRailType,              "GetCurrentRailType",              1, ".");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::SetCurrentRailType,              "SetCurrentRailType",              2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainCanRunOnRail,               "TrainCanRunOnRail",               3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::TrainHasPowerOnRail,             "TrainHasPowerOnRail",             3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailType,                     "GetRailType",                     2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::ConvertRailType,                 "ConvertRailType",                 4, ".iii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailDepotFrontTile,           "GetRailDepotFrontTile",           2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailStationDirection,         "GetRailStationDirection",         2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailDepot,                  "BuildRailDepot",                  3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailStation,                "BuildRailStation",                6, ".iiiii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildNewGRFRailStation,          "BuildNewGRFRailStation",          11, ".iiiiiiiiib");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailWaypoint,               "BuildRailWaypoint",               2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailWaypointTileRectangle, "RemoveRailWaypointTileRectangle", 4, ".iib");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailStationTileRectangle,  "RemoveRailStationTileRectangle",  4, ".iib");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetRailTracks,                   "GetRailTracks",                   2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRailTrack,                  "BuildRailTrack",                  3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRailTrack,                 "RemoveRailTrack",                 3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::AreTilesConnected,               "AreTilesConnected",               4, ".iii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildRail,                       "BuildRail",                       4, ".iii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveRail,                      "RemoveRail",                      4, ".iii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetSignalType,                   "GetSignalType",                   3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::BuildSignal,                     "BuildSignal",                     4, ".iii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::RemoveSignal,                    "RemoveSignal",                    3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetBuildCost,                    "GetBuildCost",                    3, ".ii");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaxSpeed,                     "GetMaxSpeed",                     2, ".i");
	SQGSRail.DefSQStaticMethod(engine, &ScriptRail::GetMaintenanceCostFactor,        "GetMaintenanceCostFactor",        2, ".i");

	SQGSRail.PostRegister(engine);
}