# HG changeset patch # User Matthew Wild # Date 1247188260 -3600 # Node ID 0c706c3d2e30730cbac1fa39ac6c18bf76a234a6 # Parent 5c62216dd5166291879d3f8c719dc5c0b61c9f23 eventmanager: Convert from Windows line endings diff -r 5c62216dd516 -r 0c706c3d2e30 core/eventmanager.lua --- a/core/eventmanager.lua Thu Jul 09 23:06:41 2009 +0100 +++ b/core/eventmanager.lua Fri Jul 10 02:11:00 2009 +0100 @@ -1,25 +1,25 @@ - -local t_insert = table.insert; -local ipairs = ipairs; - -module "eventmanager" - -local event_handlers = {}; - -function add_event_hook(name, handler) - if not event_handlers[name] then - event_handlers[name] = {}; - end - t_insert(event_handlers[name] , handler); -end - -function fire_event(name, ...) - local event_handlers = event_handlers[name]; - if event_handlers then - for name, handler in ipairs(event_handlers) do - handler(...); - end - end -end - + +local t_insert = table.insert; +local ipairs = ipairs; + +module "eventmanager" + +local event_handlers = {}; + +function add_event_hook(name, handler) + if not event_handlers[name] then + event_handlers[name] = {}; + end + t_insert(event_handlers[name] , handler); +end + +function fire_event(name, ...) + local event_handlers = event_handlers[name]; + if event_handlers then + for name, handler in ipairs(event_handlers) do + handler(...); + end + end +end + return _M; \ No newline at end of file