This commit is contained in:
Enrique García 2011-10-27 00:27:21 +02:00
parent 5f0009605c
commit 3131f2d158

View File

@ -19,7 +19,7 @@ local function findNodeById(self, id)
end end
local function createNode(self, event) local function createNode(self, event)
self._nodes[event] = {} self._nodes[event] = {actions = {}}
return self._nodes[event] return self._nodes[event]
end end
@ -29,13 +29,13 @@ end
local function registerActionInNode(self, node, action) local function registerActionInNode(self, node, action)
local id = {} local id = {}
node[id] = action node.actions[id] = action
self._ids[id] = node self._ids[id] = node
return id return id
end end
local function unregisterActionFromNode(self, node, id) local function unregisterActionFromNode(self, node, id)
node[id] = nil node.actions[id] = nil
self._ids[id] = nil self._ids[id] = nil
end end
@ -54,7 +54,7 @@ end
function beholder:trigger(event,...) function beholder:trigger(event,...)
local node = findNode(self, event) or {} local node = findNode(self, event) or {}
for _,action in pairs(node) do for _,action in pairs(node.actions) do
action(...) action(...)
end end
end end