lib/gamebox/core/timer_manager.rb
# add block to be executed every interval_ms millis
add block to be executed every interval_ms millis
add block to be executed every interval_ms millis
def add_timer(name, interval_ms, recurring = true, &block)
    raise "timer [#{name}] already exists" if @timers[name]
    @timers[name] = {
      count: 0, recurring: recurring,
      interval_ms: interval_ms, callback: block}
  end
def add_timer ( name , interval_ms , recurring = true , & block ) raise "timer [#{name}] already exists" if @timers [ name ] @timers [ name ] = { count : 0 , recurring : recurring , interval_ms : interval_ms , callback : block } end
add block to be executed every interval_ms millis
add block to be executed every interval_ms millis
name
<not_specific>
interval_ms
<not_specific>
recurring
<not_specific>
block
<not_specific>