mirror of
https://github.com/1bardesign/batteries.git
synced 2024-11-22 14:14:36 +00:00
[added] state_machine:_call supports varargs
This commit is contained in:
parent
1e07dd9746
commit
27790c69a8
@ -38,11 +38,11 @@ function state_machine:_get_state()
|
||||
return self.states[self.current_state]
|
||||
end
|
||||
|
||||
--make an internal call, with up to 4 arguments
|
||||
function state_machine:_call(name, a, b, c, d)
|
||||
--make an internal call
|
||||
function state_machine:_call(name, ...)
|
||||
local state = self:_get_state()
|
||||
if state and type(state[name]) == "function" then
|
||||
return state[name](self, state, a, b, c, d)
|
||||
return state[name](self, state, ...)
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user