aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation/init.lua
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2019-01-24 13:43:22 +0100
committerorwell96 <orwell@bleipb.de>2019-01-24 13:43:22 +0100
commit2976bae4522a1682808db55473d9f824c7155cc6 (patch)
tree18cbfebbbf2d46a005499f8255b902b7e6c5e3da /advtrains_line_automation/init.lua
parent1c3ea960415fcbd63c5f1b2cd8a5b25f79d2879f (diff)
downloadadvtrains-2976bae4522a1682808db55473d9f824c7155cc6.tar.gz
advtrains-2976bae4522a1682808db55473d9f824c7155cc6.tar.bz2
advtrains-2976bae4522a1682808db55473d9f824c7155cc6.zip
Point speed restriction rails
Diffstat (limited to 'advtrains_line_automation/init.lua')
-rw-r--r--advtrains_line_automation/init.lua24
1 files changed, 21 insertions, 3 deletions
diff --git a/advtrains_line_automation/init.lua b/advtrains_line_automation/init.lua
index 5521ee9..77e66b3 100644
--- a/advtrains_line_automation/init.lua
+++ b/advtrains_line_automation/init.lua
@@ -1,6 +1,18 @@
-- Advtrains line automation system
-advtrains.lines = {}
+advtrains.lines = {
+ -- [station code] = {name=...}
+ stations = {},
+
+ --[[ [new pos hash] = {
+ stn = <station code>,
+ platform = <platform identifier>,
+ doors = <door side L,R,C>
+ wait = <least wait time>
+ signal = <position of signal that is the "exit signal" for this platform>
+ }]]
+ stops = {},
+}
local modpath = minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM
@@ -9,9 +21,15 @@ dofile(modpath.."stoprail.lua")
function advtrains.lines.load(data)
-
+ if data then
+ advtrains.lines.stations = data.stations or {}
+ advtrains.lines.stops = data.stops or {}
+ end
end
function advtrains.lines.save()
- return {}
+ return {
+ stations = advtrains.lines.stations,
+ stops = advtrains.lines.stops
+ }
end