From 2976bae4522a1682808db55473d9f824c7155cc6 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 24 Jan 2019 13:43:22 +0100 Subject: Point speed restriction rails --- advtrains_line_automation/init.lua | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'advtrains_line_automation') 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 = , + platform = , + doors = + wait = + signal = + }]] + 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 -- cgit v1.2.3