lib/gamebox/core/timer_manager.rb
# update each timers counts, call any blocks that are over their interval
update each timers counts, call any blocks that are over their interval
update each timers counts call any blocks that are over their interval
def update(time_delta)
    @callbacks.clear
    @dead_timers.clear
    @timers.each do |name, timer_hash|
      timer_hash[:count] += time_delta
      if timer_hash[:count] > timer_hash[:interval_ms]
        timer_hash[:count] -= timer_hash[:interval_ms]
        @callbacks << timer_hash[:callback]
        @dead_timers << name unless timer_hash[:recurring]
      end
    end
    @dead_timers.each do |name|
      remove_timer name
    end
    @callbacks.each &:call
  end
def update ( time_delta ) @callbacks . clear @dead_timers . clear @timers . each do | name , timer_hash | timer_hash [ :count ] += time_delta if timer_hash [ :count ] > timer_hash [ :interval_ms ] timer_hash [ :count ] -= timer_hash [ :interval_ms ] @callbacks << timer_hash [ :callback ] @dead_timers << name unless timer_hash [ :recurring ] end end @dead_timers . each do | name | remove_timer name end @callbacks . each & :call end
update each timers counts, call any blocks that are over their interval
update each timers counts call any blocks that are over their interval
time_delta
<not_specific>