Module: Moon::EntitySystem::Component

Defined in:
lib/moon/packages/entity_system/component.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods

Constant Summary collapse

@@manager =
Manager.new

Class Method Summary collapse

Class Method Details

.included(mod) ⇒ Object


58
59
60
61
62
63
64
# File 'lib/moon/packages/entity_system/component.rb', line 58

def self.included(mod)
  mod.send :include, Moon::DataModel::Fields
  mod.extend         ClassMethods
  mod.send :include, InstanceMethods

  mod.register mod.to_s.demodulize.downcase.to_sym
end

.load(data) ⇒ Object


66
67
68
# File 'lib/moon/packages/entity_system/component.rb', line 66

def self.load(data)
  self[data['component_type'].to_sym].new(data.symbolize_keys)
end

.managerObject


7
8
9
# File 'lib/moon/packages/entity_system/component.rb', line 7

def self.manager
  @@manager
end