Sha256: c3c0185d9288387a1b4d5c24508478242681128f7e58dfd55893528e372981cc
Contents?: true
Size: 518 Bytes
Versions: 2
Compression:
Stored size: 518 Bytes
Contents
module Lotu class StalkerSystem def initialize(user, opts={}) default_opts = { :stalk => [Actor] } opts = default_opts.merge!(opts) @stalked = {} opts[:stalk].each do |type| @stalked[type] = 0 end end def update @stalked.each_key do |type| @stalked[type] = ObjectSpace.each_object(type).count end end def to_s @stalked.map do |type, count| "#{type}: #{count}" end end def draw;end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
lotu-0.1.10 | lib/lotu/systems/stalker_system.rb |
lotu-0.1.9 | lib/lotu/systems/stalker_system.rb |