Module: Lich::Common::MapBase

Included in:
Map
Defined in:
documented/common/map/map_base.rb

Overview

Base module containing shared map functionality Include this in game-specific Map classes

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(base) ⇒ void

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

This method returns an undefined value.

Hook invoked when MapBase is included in a class; sets up class methods, instance methods, and tag cache ownership.

Parameters:

  • base (Class) —

    the class that includes MapBase



166
167
168
169
170
171
172
173
174
175
# File 'documented/common/map/map_base.rb', line 166

def self.included(base)
  base.extend(ClassMethods)
  base.include(InstanceMethods)
  # The tag cache lives on class-instance variables, which subclasses do
  # not share. Room subclasses Map and inherits these class methods, so
  # without a single owner a query through Room would memoize a second
  # cache that Map's invalidations never reach. Mark the includer as owner
  # and resolve to it from any subclass, see #tag_cache_host.
  base.instance_variable_set(:@tag_cache_owner, true)
end