Sha256: 80d1b4e7de0927185397ac5d79b38dcaf9eac42c42da273c8eca81aaf4473c08
Contents?: true
Size: 562 Bytes
Versions: 2
Compression:
Stored size: 562 Bytes
Contents
module Darkholme # Top-level class for storing data on an Entity that a System uses class Component @next_bit = 0 @bits = {} # Get a unique bit for a Component class # # @param klass [Class] The class to generate (or look up) the bit for # # @return [Fixnum] The bit for that class def self.bit_for(klass) @bits[klass] ||= @next_bit += 1 end # Get the current instance's class' bit # # @return [Fixnum] The bit for the instance's class def bit Component.bit_for(self.class) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
darkholme-1.0.1 | lib/darkholme/component.rb |
darkholme-1.0.0 | lib/darkholme/component.rb |