diff options
author | orwell96 <orwell@bleipb.de> | 2019-08-26 23:08:02 +0200 |
---|---|---|
committer | orwell96 <orwell@bleipb.de> | 2019-08-26 23:08:02 +0200 |
commit | 7b488f40d95c2d68db898d7cb228e17e001cea73 (patch) | |
tree | 686712ef9e75631feebdbac4218a26fa73a72975 /advtrains_line_automation/init.lua | |
parent | d867cd723f373b0fc52bd2cdd19176a29598f8be (diff) | |
download | advtrains-7b488f40d95c2d68db898d7cb228e17e001cea73.tar.gz advtrains-7b488f40d95c2d68db898d7cb228e17e001cea73.tar.bz2 advtrains-7b488f40d95c2d68db898d7cb228e17e001cea73.zip |
Add lines scheduler for reliable railway-time scheduling(which is also safer than the atlatc scheduler) and document new atlatc functions
Diffstat (limited to 'advtrains_line_automation/init.lua')
-rw-r--r-- | advtrains_line_automation/init.lua | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/advtrains_line_automation/init.lua b/advtrains_line_automation/init.lua index 0f4a4eb..7b758bc 100644 --- a/advtrains_line_automation/init.lua +++ b/advtrains_line_automation/init.lua @@ -19,6 +19,7 @@ advtrains.lines = { local modpath = minetest.get_modpath(minetest.get_current_modname()) .. DIR_DELIM dofile(modpath.."railwaytime.lua") +dofile(modpath.."scheduler.lua") dofile(modpath.."stoprail.lua") @@ -27,6 +28,7 @@ function advtrains.lines.load(data) advtrains.lines.stations = data.stations or {} advtrains.lines.stops = data.stops or {} advtrains.lines.rwt.set_time(data.rwt_time) + advtrains.lines.sched.load(data.scheduler_queue) end end @@ -34,10 +36,12 @@ function advtrains.lines.save() return { stations = advtrains.lines.stations, stops = advtrains.lines.stops, - rwt_time = advtrains.lines.rwt.get_time() + rwt_time = advtrains.lines.rwt.get_time(), + scheduler_queue = advtrains.lines.sched.save() } end function advtrains.lines.step(dtime) advtrains.lines.rwt.step(dtime) + advtrains.lines.sched.run() end |