2018-11-29 08:52:56 -08:00
|
|
|
-- Advtrains line automation system
|
|
|
|
|
2019-01-24 04:43:22 -08:00
|
|
|
advtrains.lines = {
|
2019-01-24 08:50:26 -08:00
|
|
|
-- [station code] = {name=..., owner=...}
|
2019-01-24 04:43:22 -08:00
|
|
|
stations = {},
|
|
|
|
|
|
|
|
--[[ [new pos hash] = {
|
|
|
|
stn = <station code>,
|
2019-01-24 08:50:26 -08:00
|
|
|
track = <platform identifier>,
|
2019-01-24 04:43:22 -08:00
|
|
|
doors = <door side L,R,C>
|
|
|
|
wait = <least wait time>
|
2019-01-24 08:50:26 -08:00
|
|
|
reverse = <boolean>
|
2019-01-24 04:43:22 -08:00
|
|
|
signal = <position of signal that is the "exit signal" for this platform>
|
|
|
|
}]]
|
|
|
|
stops = {},
|
|
|
|
}
|
2018-11-29 08:52:56 -08:00
|
|
|
|
|
|
|
|
|
|
|
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
|
2018-11-29 08:52:56 -08:00
|
|
|
end
|
|
|
|
|
|
|
|
function advtrains.lines.save()
|
2019-01-24 04:43:22 -08:00
|
|
|
return {
|
|
|
|
stations = advtrains.lines.stations,
|
|
|
|
stops = advtrains.lines.stops
|
|
|
|
}
|
2018-11-29 08:52:56 -08:00
|
|
|
end
|