znmud-0.0.1/benchmark/
znmud-0.0.1/cmd/
znmud-0.0.1/cmd/emotes/
znmud-0.0.1/cmd/objects/
znmud-0.0.1/cmd/tiny/
znmud-0.0.1/doc/
znmud-0.0.1/farts/
znmud-0.0.1/lib/
znmud-0.0.1/lib/combat/
znmud-0.0.1/lib/core/bodytypes/
znmud-0.0.1/lib/engine/
znmud-0.0.1/lib/farts/
znmud-0.0.1/logs/
#
# file::    timer.rb
# author::  Jon A. Lambert
# version:: 2.8.0
# date::    01/19/2006
#

# Additional Contributor: Craig Smith 1/28/2009

# This source code copyright (C) 2005, 2006 by Jon A. Lambert
# All rights reserved.
#
# Released under the terms of the TeensyMUD Public License
# See LICENSE file for additional information.
#

# The Timer class defines the necessary data to keep track of timers for
# objects
#
class Timer
  attr_accessor :id, :name, :time, :args

  # Constructor for a Timer object.
  # [+id+]     Oid of object that will execute the timed event
  # [+name+]   Symbol name of function in Oid to execute
  # [+time+]   Time in seconds for the countdown
  # [+args+]   Optional - Additional Args to pass the event
  # [+return+] A reference to the Event.
  def initialize(id,name,time,args=nil)
    @id,@name,@time,@counter,@args=id,name,time,time,args
  end

  def fire?
    @counter -= 1
    @counter < 1
  end

  def reset
    @counter = @time
  end

end