<commit_before>local Class = require 'lib.hump.class'
local EntityFactory = getClass 'pud.entity.EntityFactory'

-- HeroFactory
-- creates entities based on data files
local HeroFactory = Class{name='HeroFactory',
	inherits=EntityFactory,
	function(self)
		EntityFactory.construct(self, 'hero')
		self._renderLevel = 5
		--[[
		-- required components (can be parent classes)
		self._requiredComponents = {
			getClass 'pud.component.HealthComponent',
			getClass 'pud.component.PositionComponent',
			getClass 'pud.component.TimeComponent',
			getClass 'pud.component.GraphicsComponent',
			getClass 'pud.component.InfoPanelComponent',
			getClass 'pud.component.CombatComponent',
			getClass 'pud.component.CollisionComponent',
			getClass 'pud.component.MotionComponent',
			getClass 'pud.component.InputComponent',
		}
		]]--
	end
}

-- destructor
function HeroFactory:destroy()
	EntityFactory.destroy(self)
end

--[[
-- add a required component with default values
function HeroFactory:_addDefaultComponent(entity, componentClass)
	-- check if the componentClass is InputComponent (or a subclass)
	if isClass('pud.component.InputComponent', componentClass) then
		-- add an AI component
		entity:addComponent(AIInputComponent())
	else
		EntityFactory._addDefaultComponent(self, entity, componentClass)
	end
end
]]--


-- the class
return HeroFactory<commit_msg>uncomment currently implemented components<commit_after>local Class = require 'lib.hump.class'
local EntityFactory = getClass 'pud.entity.EntityFactory'

-- HeroFactory
-- creates entities based on data files
local HeroFactory = Class{name='HeroFactory',
	inherits=EntityFactory,
	function(self)
		EntityFactory.construct(self, 'hero')
		self._renderLevel = 5
		-- required components (can be parent classes)
		self._requiredComponents = {
			--getClass 'pud.component.HealthComponent',
			--getClass 'pud.component.PositionComponent',
			--getClass 'pud.component.TimeComponent',
			getClass 'pud.component.GraphicsComponent',
			--getClass 'pud.component.InfoPanelComponent',
			--getClass 'pud.component.CombatComponent',
			getClass 'pud.component.CollisionComponent',
			getClass 'pud.component.MotionComponent',
			--getClass 'pud.component.InputComponent',
		}
	end
}

-- destructor
function HeroFactory:destroy()
	EntityFactory.destroy(self)
end

--[[
-- add a required component with default values
function HeroFactory:_addDefaultComponent(entity, componentClass)
	-- check if the componentClass is InputComponent (or a subclass)
	if isClass('pud.component.InputComponent', componentClass) then
		-- add an AI component
		entity:addComponent(AIInputComponent())
	else
		EntityFactory._addDefaultComponent(self, entity, componentClass)
	end
end
]]--


-- the class
return HeroFactory
{'fraction_non_alphanumeric': 0.10591222343126587, 'fraction_numerical': 0.0007254261878853826, 'mean_word_length': 5.048245614035087, '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': '5418726', 'n_tokens_mistral': 825, 'n_tokens_neox': 780, 'n_words': 188}