First draft of some kind of Action Queue (just like the globalstep queue in to_update), but more flexible and also including delay functionality (mesecon_delayer).

The queue is also saved to a file, so that when restarting mesecons, delayers resume to the state they had when the game shut down. Needs testing.
This commit is contained in:
Jeija
2014-01-10 22:29:18 +01:00
parent 3f76b77001
commit 2d004b19ea
6 changed files with 177 additions and 159 deletions

View File

@ -181,3 +181,14 @@ function mesecon:tablecopy(table) -- deep table copy
return newtable
end
function mesecon:cmpAny(t1, t2)
if type(t1) ~= type(t2) then return false end
if type(t1) ~= "table" and type(t2) ~= "table" then return t1 == t2 end
for i, e in pairs(t1) do
if not mesecon:cmpAny(e, t2[i]) then return false end
end
return true
end