local LootDropSystem = inherited("LootDropSystem", SystemMap)

function LootDropSystem:new()
	local ms = instance(self)
	return ms
end

function LootDropSystem:dynamic_wants(ent)
	return ent.aspects.health and ent.aspects.container and ent.health <= 0 and ent.container
end

function LootDropSystem:ent_added(ent)
	
end

function LootDropSystem:ent_removed(ent)
	local container = ent.container
	if container then
		container:generate_loot(self.world.universe, ent.x, ent.y)
		ent:set_container(nil)
	end
end

return LootDropSystem