Class: LZRTag::Hook::Debug

Inherits:
Base
  • Object
show all
Defined in:
lib/lzrtag/hooks/standard_hooks.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

describe_option, getCBs, getOptionDescriptions, on, #on, #on_hookin, #on_hookout, #process_raw_hit

Constructor Details

#initializeDebug

Returns a new instance of Debug.



10
11
12
13
14
15
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 10

def initialize()
	super();

	@eventWhitelist = Array.new();
	@eventBlacklist = Array.new();
end

Instance Attribute Details

#eventBlacklistObject

Returns the value of attribute eventBlacklist.



8
9
10
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 8

def eventBlacklist
  @eventBlacklist
end

#eventWhitelistObject

Returns the value of attribute eventWhitelist.



7
8
9
# File 'lib/lzrtag/hooks/standard_hooks.rb', line 7

def eventWhitelist
  @eventWhitelist
end

Instance Method Details

#consume_event(evtName, data) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# 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

	puts "Caught event: #{evtName} with data: #{data}";
end