mirror of
https://github.com/kikito/beholder.lua.git
synced 2024-12-16 00:34:21 +00:00
improved some table usages
This commit is contained in:
parent
9dcf8055cf
commit
2a6aa41e55
@ -15,8 +15,7 @@ local function copy(t)
|
|||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
local function extractEventAndActionFromParams(...)
|
local function extractEventAndActionFromParams(params)
|
||||||
local params = {...}
|
|
||||||
local action = table.remove(params, #params)
|
local action = table.remove(params, #params)
|
||||||
return params, action
|
return params, action
|
||||||
end
|
end
|
||||||
@ -75,7 +74,7 @@ function beholder:reset()
|
|||||||
end
|
end
|
||||||
|
|
||||||
function beholder:observe(...)
|
function beholder:observe(...)
|
||||||
local event, action = extractEventAndActionFromParams(...)
|
local event, action = extractEventAndActionFromParams({...})
|
||||||
return addActionToNode(self, findOrCreateNode(self, event), action)
|
return addActionToNode(self, findOrCreateNode(self, event), action)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -84,8 +83,7 @@ function beholder:stopObserving(id)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function beholder:trigger(...)
|
function beholder:trigger(...)
|
||||||
local event = {...}
|
return executeNodeActions(self, {...})
|
||||||
return executeNodeActions(self, event)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
beholder:reset()
|
beholder:reset()
|
||||||
|
Loading…
Reference in New Issue
Block a user