summaryrefslogtreecommitdiff
path: root/src/script/api/game/game_station.hpp.sq
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2011-12-19 20:57:34 +0000
committertruebrain <truebrain@openttd.org>2011-12-19 20:57:34 +0000
commit9359c6fc47f6fabddc399d044ea74dc6ebfdfb05 (patch)
tree0e29635b5f349432059dc99b36df10aac24981f8 /src/script/api/game/game_station.hpp.sq
parent436cf09923d881f3c11c8a4b6262c0a89ad1ee73 (diff)
downloadopenttd-9359c6fc47f6fabddc399d044ea74dc6ebfdfb05.tar.xz
(svn r23615) -Add: more API functions exposed to NoGo (part 2)
Diffstat (limited to 'src/script/api/game/game_station.hpp.sq')
-rw-r--r--src/script/api/game/game_station.hpp.sq61
1 files changed, 61 insertions, 0 deletions
diff --git a/src/script/api/game/game_station.hpp.sq b/src/script/api/game/game_station.hpp.sq
new file mode 100644
index 000000000..5aa696794
--- /dev/null
+++ b/src/script/api/game/game_station.hpp.sq
@@ -0,0 +1,61 @@
+/* $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_station.hpp"
+#include "../template/template_station.hpp.sq"
+
+
+template <> const char *GetClassName<ScriptStation, ST_GS>() { return "GSStation"; }
+
+void SQGSStation_Register(Squirrel *engine)
+{
+ DefSQClass<ScriptStation, ST_GS> SQGSStation("GSStation");
+ SQGSStation.PreRegister(engine, "GSBaseStation");
+ SQGSStation.AddConstructor<void (ScriptStation::*)(), 1>(engine, "x");
+
+ SQGSStation.DefSQConst(engine, ScriptStation::ERR_STATION_BASE, "ERR_STATION_BASE");
+ SQGSStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION, "ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION");
+ SQGSStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_MANY_STATIONS, "ERR_STATION_TOO_MANY_STATIONS");
+ SQGSStation.DefSQConst(engine, ScriptStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN, "ERR_STATION_TOO_MANY_STATIONS_IN_TOWN");
+ SQGSStation.DefSQConst(engine, ScriptStation::STATION_TRAIN, "STATION_TRAIN");
+ SQGSStation.DefSQConst(engine, ScriptStation::STATION_TRUCK_STOP, "STATION_TRUCK_STOP");
+ SQGSStation.DefSQConst(engine, ScriptStation::STATION_BUS_STOP, "STATION_BUS_STOP");
+ SQGSStation.DefSQConst(engine, ScriptStation::STATION_AIRPORT, "STATION_AIRPORT");
+ SQGSStation.DefSQConst(engine, ScriptStation::STATION_DOCK, "STATION_DOCK");
+ SQGSStation.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_STATION, 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");
+
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::IsValidStation, "IsValidStation", 2, ".i");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetStationID, "GetStationID", 2, ".i");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoWaiting, "GetCargoWaiting", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetCargoRating, "GetCargoRating", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetCoverageRadius, "GetCoverageRadius", 2, ".i");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetStationCoverageRadius, "GetStationCoverageRadius", 2, ".i");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetDistanceManhattanToTile, "GetDistanceManhattanToTile", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetDistanceSquareToTile, "GetDistanceSquareToTile", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::IsWithinTownInfluence, "IsWithinTownInfluence", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::HasStationType, "HasStationType", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::HasRoadType, "HasRoadType", 3, ".ii");
+ SQGSStation.DefSQStaticMethod(engine, &ScriptStation::GetNearestTown, "GetNearestTown", 2, ".i");
+
+ SQGSStation.PostRegister(engine);
+}