mirror of
https://github.com/vrld/hump.git
synced 2024-11-23 12:24:19 +00:00
Allow registering functions to signal patterns
This commit is contained in:
parent
40aa4cb7c5
commit
6154e24b49
@ -64,6 +64,13 @@ function Registry:emitPattern(p, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function Registry:registerPattern(p, f)
|
||||
for s in pairs(self) do
|
||||
if s:match(p) then self:register(s, f) end
|
||||
end
|
||||
return f
|
||||
end
|
||||
|
||||
function Registry:removePattern(p, ...)
|
||||
for s in pairs(self) do
|
||||
if s:match(p) then self:remove(s, ...) end
|
||||
|
Loading…
Reference in New Issue
Block a user