class LZRTag::Hook::Debug

Attributes

eventBlacklist[RW]
eventWhitelist[RW]

Public Class Methods

new(handler) click to toggle source
Calls superclass method LZRTag::Hook::Base::new
# File lib/lzrtag/hooks/standard_hooks.rb, line 10
def initialize(handler)
        super(handler, "DBG");

        @eventWhitelist = Array.new();
        @eventBlacklist = [:slowTick, :gameTick, :playerInBeacon];
end

Public Instance Methods

consume_event(evtName, data) click to toggle source
Calls superclass method LZRTag::Hook::Base#consume_event
# File lib/lzrtag/hooks/standard_hooks.rb, line 17
def consume_event(evtName, data)
        super(evtName, data);

        return if @eventBlacklist.include? evtName
        unless(@eventWhitelist.empty?)
                return unless @eventWhitelist.include? evtName
        end

        x_logd "Event: #{evtName} with data: #{data}";
end