diff options
Diffstat (limited to 'component_manager.rb')
| -rw-r--r-- | component_manager.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/component_manager.rb b/component_manager.rb index 2f1b2e2..33cb931 100644 --- a/component_manager.rb +++ b/component_manager.rb @@ -7,18 +7,20 @@ class FelFlame @component_map = [] class <<self def entity_destroyed(entity_id) + #TODO: make it 'search by entity' to remove @component_map.delete(entity_id) - constants.each do |component| #TODO change delete to remove + constants.each do |component| #TODO: change delete to remove component.delete(entity_id) unless (component.signature & FelFlame::Entity.signatures[entity_id]).zero? end end - def entity_created(entity_id) - constants.each do |component| - const_get(component.to_s).add(entity_id) unless (const_get(component.to_s).signature & FelFlame::Entity.signatures[entity_id]).zero? - end - @component_map[entity_id] = [] - end + #def entity_created(entity_id) + # #TODO: probably delete this, I dont think its needed in the new system + # constants.each do |component| + # const_get(component.to_s).add(entity_id) unless (const_get(component.to_s).signature & FelFlame::Entity.signatures[entity_id]).zero? + # end + # @component_map[entity_id] = [] + #end def new(component_name, *attrs, **attrs_with_defaults) const_set(component_name, Class.new(FelFlame::Helper::BaseComponent) {}) |
