-- $LastChangedDate: 2010-04-12 23:22:52 -0500 (Mon, 12 Apr 2010) $
-- 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
