Stat.rb

RubyMud/Stat.rb · 420 B

From the archive rbmud-0.1rc2.tar.gz

Download the archive   « Back to the archive contents

module RubyMud

class Stat

	# ##########
	# Properties
	# ##########

	attr_accessor :maxValue,:owner

	def value=(val)  
		@value = val		
		onChange()
	end  	
	
	def value
		@value
	end
	
	# ######
	# Events
	# ######

	# Things that happen when @value reaches 0	
	def onChange()
	end  		  	  	
	
	def initialize(owner,value)
		@owner = owner
		@value = value
		@maxValue = value
		owner.addStat(self)
	end

end

end

Site Stats

Snippets: 1791
Codebases: 571