1
0
Fork 0
mirror of https://github.com/Reuh/ubiquitousse.git synced 2025-10-27 17:19:31 +00:00

ecs: add callbackFiltered and emitFiltered

This commit is contained in:
Étienne Fildadut 2022-10-13 00:24:47 +09:00
parent bd28610ff4
commit aa332a0adf
20 changed files with 697 additions and 568 deletions

View file

@ -0,0 +1,23 @@
local timer -- ./ecs/commonsystems/timer.can:4
timer = require((...):match("^(.-)ecs%.timer") .. "scene") -- ./ecs/commonsystems/timer.can:4
return { -- ./ecs/commonsystems/timer.can:6
["name"] = "timer", -- ./ecs/commonsystems/timer.can:7
["filter"] = "timer", -- ./ecs/commonsystems/timer.can:8
["default"] = {}, -- ./ecs/commonsystems/timer.can:9
["process"] = function(self, e, t, dt) -- ./ecs/commonsystems/timer.can:12
t:update(dt) -- ./ecs/commonsystems/timer.can:13
if t:dead() then -- ./ecs/commonsystems/timer.can:14
self["world"]:remove(t["entity"]) -- ./ecs/commonsystems/timer.can:15
end -- ./ecs/commonsystems/timer.can:15
end, -- ./ecs/commonsystems/timer.can:15
["run"] = function(self, func) -- ./ecs/commonsystems/timer.can:20
local t = timer["run"](func) -- ./ecs/commonsystems/timer.can:21
self["world"]:add({ ["timer"] = t }) -- ./ecs/commonsystems/timer.can:23
return t -- ./ecs/commonsystems/timer.can:25
end, -- ./ecs/commonsystems/timer.can:25
["tween"] = function(self, duration, tbl, to, method) -- ./ecs/commonsystems/timer.can:28
local t = timer["tween"](duration, tbl, to, method) -- ./ecs/commonsystems/timer.can:29
self["world"]:add({ ["timer"] = t }) -- ./ecs/commonsystems/timer.can:31
return t -- ./ecs/commonsystems/timer.can:33
end -- ./ecs/commonsystems/timer.can:33
} -- ./ecs/commonsystems/timer.can:33