diff --git a/manual/luadoc/class.json b/manual/luadoc/class.json index 5cd571aa..7d52030a 100644 --- a/manual/luadoc/class.json +++ b/manual/luadoc/class.json @@ -205,6 +205,10 @@ "TRAIN_LIST": { "type": "constant" }, + "TRAIN_PATH_FINDER": { + "type": "constant", + "since": "0.4" + }, "TRAIN_ZONE_STATUS": { "type": "constant", "since": "0.3" diff --git a/manual/luadoc/object/pathfinder.json b/manual/luadoc/object/pathfinder.json new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/manual/luadoc/object/pathfinder.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/manual/luadoc/object/trainpathfinder.json b/manual/luadoc/object/trainpathfinder.json new file mode 100644 index 00000000..9252f317 --- /dev/null +++ b/manual/luadoc/object/trainpathfinder.json @@ -0,0 +1,19 @@ +{ + "reserve": { + "parameters": [ + { + "name": "from_block" + }, + { + "name": "from_direction" + }, + { + "name": "to_block" + }, + { + "name": "to_direction" + } + ], + "since": "0.4" + } +} \ No newline at end of file diff --git a/manual/luadoc/object/world.json b/manual/luadoc/object/world.json index 8e614eb1..5baee672 100644 --- a/manual/luadoc/object/world.json +++ b/manual/luadoc/object/world.json @@ -17,6 +17,9 @@ "clock": { "since": "0.2" }, + "train_path_finder": { + "since": "0.4" + }, "trains": {}, "rail_vehicles": {}, "state": { @@ -48,4 +51,4 @@ "since": "0.1" }, "zones": {} -} +} \ No newline at end of file diff --git a/server/src/lua/class.cpp b/server/src/lua/class.cpp index 196fd04e..5a83db4d 100644 --- a/server/src/lua/class.cpp +++ b/server/src/lua/class.cpp @@ -1,9 +1,8 @@ /** - * server/src/lua/classid.cpp + * This file is part of Traintastic, + * see . * - * This file is part of the traintastic source code. - * - * Copyright (C) 2021-2025 Reinder Feenstra + * Copyright (C) 2021-2026 Reinder Feenstra * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -30,6 +29,7 @@ #include "../board/board.hpp" #include "../board/boardlist.hpp" +#include "../board/pathfinder/trainpathfinder.hpp" #include "../board/tile/misc/labeltile.hpp" #include "../board/tile/misc/pushbuttontile.hpp" @@ -162,6 +162,7 @@ void Class::registerValues(lua_State* L) registerValue(L, "BOARD"); registerValue(L, "BOARD_LIST"); + registerValue(L, "TRAIN_PATH_FINDER"); registerValue(L, "LABEL_TILE"); registerValue(L, "PUSH_BUTTON_TILE");