aboutsummaryrefslogtreecommitdiff
path: root/advtrains_line_automation/init.lua
diff options
context:
space:
mode:
authorGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-10-21 16:39:54 +0200
committerGabriel Pérez-Cerezo <gabriel@gpcf.eu>2019-10-21 16:39:54 +0200
commit74f7233d216da5a37a36fd54be4d8d6a4a278c8b (patch)
treea39a293363c307dad828911bf92788ac572db958 /advtrains_line_automation/init.lua
parent7977776b4a8067ea513d95ab2b0d699456596209 (diff)
parent27f85f2e225e038789036fac4407d97aacb2189b (diff)
downloadadvtrains-74f7233d216da5a37a36fd54be4d8d6a4a278c8b.tar.gz
advtrains-74f7233d216da5a37a36fd54be4d8d6a4a278c8b.tar.bz2
advtrains-74f7233d216da5a37a36fd54be4d8d6a4a278c8b.zip
Merge branch 'master' of https://git.bananach.space/advtrains
Diffstat (limited to 'advtrains_line_automation/init.lua')
-rw-r--r--advtrains_line_automation/init.lua6
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