-- $LastChangedDate: 2010-05-25 21:26:05 -0400 (Tue, 25 May 2010) $
-- LEGAL: COPYRIGHT (C) 2010 JIM E. BROOKS WWW.PALOMINO3D.ORG
-- Events.
-- See module.txt for Lua pitfalls.

------------------
-- Events class --
------------------

Events = {
    resetCallbacks = {},
}

-- (private subroutine)
function Events:Broadcast( callbackTable )
    for k,callback in KEYS_VALS(callbackTable) do
        callback()
    end
end

-----------------
-- reset event --
-----------------

function Events:RegisterReset( callback )
    table.insert( self.resetCallbacks, callback )
end

function Events:BroadcastReset()
    self:Broadcast( self.resetCallbacks )
end
