<commit_before>
module Gubby
	class GameEntity
		
		attr_accessor	:entity_name,
									:engine
		
		attr_reader :components
		
		def initialize(name = nil, *components)
			
			@components = []
			@entity_name = name unless name.nil?
			add_component(*components)
			
		end
		
		def add_component(*components)
			
			components.each do |c|
				extend(c)
				@components.push(c)
			end
			
			@engine.refresh_entity(self) unless @engine.nil?
			
		end
		
		def remove_component(*components)
			
			components.each do |c|
				unextend(c)
				@components.delete(c)
			end

			@engine.refresh_entity(self) unless @engine.nil?

		end<commit_msg>Added hooks for adding components to entities<commit_after>
module Gubby
	class GameEntity
		
		attr_accessor	:entity_name,
									:engine
		
		attr_reader :components
		
		def initialize(name = nil, *components)
			
			@components = []
			@entity_name = name unless name.nil?
			add_component(*components)
			
		end
		
		def add_component(*components)
			
			components.each do |c|
				extend(c)
				@components.push(c)
				if self.respond_to?(:component_added) then
					self.component_added
				end
			end
			
			@engine.refresh_entity(self) unless @engine.nil?
			
		end
		
		def remove_component(*components)
			
			components.each do |c|
				unextend(c)
				@components.delete(c)
				if self.respond_to?(:component_removed) then
					self.component_removed
				end
			end

			@engine.refresh_entity(self) unless @engine.nil?

		end
{'fraction_non_alphanumeric': 0.09054054054054055, 'fraction_numerical': 0.0, 'mean_word_length': 2.8871391076115485, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3592103', 'n_tokens_mistral': 643, 'n_tokens_neox': 462, 'n_words': 105}