advtrains/advtrains_line_automation/init.lua

37 lines
764 B
Lua
Raw Normal View History

-- Advtrains line automation system
2019-01-24 04:43:22 -08:00
advtrains.lines = {
-- [station code] = {name=..., owner=...}
2019-01-24 04:43:22 -08:00
stations = {},
--[[ [new pos hash] = {
stn = <station code>,
track = <platform identifier>,
2019-01-24 04:43:22 -08:00
doors = <door side L,R,C>
wait = <least wait time>
reverse = <boolean>
2019-01-24 04:43:22 -08:00
signal = <position of signal that is the "exit signal" for this platform>
}]]
stops = {},
}
local modpath = minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM
dofile(modpath.."stoprail.lua")
function advtrains.lines.load(data)
2019-01-24 04:43:22 -08:00
if data then
advtrains.lines.stations = data.stations or {}
advtrains.lines.stops = data.stops or {}
end
end
function advtrains.lines.save()
2019-01-24 04:43:22 -08:00
return {
stations = advtrains.lines.stations,
stops = advtrains.lines.stops
}
end