summaryrefslogtreecommitdiff
path: root/src/script/api/ai/ai_station.hpp.sq
blob: 2278faf238b02e805a03b0b2286895683b792ba9 (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
/*
 * 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_station.hpp"
#include "../template/template_station.hpp.sq"


template <> const char *GetClassName<ScriptStation, ST_AI>() { return "AIStation"; }

void SQAIStation_Register(Squirrel *engine)
{
	DefSQClass<ScriptStation, ST_AI> SQAIStation("AIStation");
	SQAIStation.PreRegister(engine, "AIBaseStation");
	SQAIStation.AddConstructor<void (ScriptStation::*)(), 1>(engine, "x");

	SQAIStation.DefSQConst(engine, ScriptStation::ERR_STATION_BASE,                         "ERR_STATION_BASE");
	SQAIStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION");
	SQAIStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_MANY_STATIONS,            "ERR_STATION_TOO_MANY_STATIONS");
	SQAIStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN,    "ERR_STATION_TOO_MANY_STATIONS_IN_TOWN");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_TRAIN,                            "STATION_TRAIN");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_TRUCK_STOP,                       "STATION_TRUCK_STOP");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_BUS_STOP,                         "STATION_BUS_STOP");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_AIRPORT,                          "STATION_AIRPORT");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_DOCK,                             "STATION_DOCK");
	SQAIStation.DefSQConst(engine, ScriptStation::STATION_ANY,                              "STATION_ANY");

	ScriptError::RegisterErrorMap(STR_ERROR_TOO_CLOSE_TO_ANOTHER_AIRPORT,    ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);
	ScriptError::RegisterErrorMap(STR_ERROR_TOO_CLOSE_TO_ANOTHER_DOCK,       ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION);
	ScriptError::RegisterErrorMap(STR_ERROR_TOO_MANY_STATIONS_LOADING,       ScriptStation::ERR_STATION_TOO_MANY_STATIONS);
	ScriptError::RegisterErrorMap(STR_ERROR_TOO_MANY_TRUCK_STOPS,            ScriptStation::ERR_STATION_TOO_MANY_STATIONS);
	ScriptError::RegisterErrorMap(STR_ERROR_TOO_MANY_BUS_STOPS,              ScriptStation::ERR_STATION_TOO_MANY_STATIONS);
	ScriptError::RegisterErrorMap(STR_ERROR_LOCAL_AUTHORITY_REFUSES_AIRPORT, ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN);

	ScriptError::RegisterErrorMapString(ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION");
	ScriptError::RegisterErrorMapString(ScriptStation::ERR_STATION_TOO_MANY_STATIONS,            "ERR_STATION_TOO_MANY_STATIONS");
	ScriptError::RegisterErrorMapString(ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN,    "ERR_STATION_TOO_MANY_STATIONS_IN_TOWN");

	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::IsValidStation,             "IsValidStation",             2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetStationID,               "GetStationID",               2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoWaiting,            "GetCargoWaiting",            3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoWaitingFrom,        "GetCargoWaitingFrom",        4, ".iii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoWaitingVia,         "GetCargoWaitingVia",         4, ".iii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoWaitingFromVia,     "GetCargoWaitingFromVia",     5, ".iiii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoPlanned,            "GetCargoPlanned",            3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoPlannedFrom,        "GetCargoPlannedFrom",        4, ".iii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoPlannedVia,         "GetCargoPlannedVia",         4, ".iii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoPlannedFromVia,     "GetCargoPlannedFromVia",     5, ".iiii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::HasCargoRating,             "HasCargoRating",             3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoRating,             "GetCargoRating",             3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetCoverageRadius,          "GetCoverageRadius",          2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetStationCoverageRadius,   "GetStationCoverageRadius",   2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetDistanceSquareToTile,    "GetDistanceSquareToTile",    3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::IsWithinTownInfluence,      "IsWithinTownInfluence",      3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::HasStationType,             "HasStationType",             3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::HasRoadType,                "HasRoadType",                3, ".ii");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::GetNearestTown,             "GetNearestTown",             2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::IsAirportClosed,            "IsAirportClosed",            2, ".i");
	SQAIStation.DefSQStaticMethod(engine, &ScriptStation::OpenCloseAirport,           "OpenCloseAirport",           2, ".i");

	SQAIStation.PostRegister(engine);
}