extends AbstractFood
class_name FoodMolecular

func _on_body_entered(body: Node2D) -> void:
	if body.has_method("collect_resource"):  # TODO: Define a "consumer" group instead?
		eat(body)
		
func eat(consumer: Node2D) -> void:
	print("Player ate: ", food_name)
	consumed.emit()
	
	apply_effect(consumer)
	
	queue_free()

func apply_effect(consumer: Node2D) -> void:
	if consumer.has_method("collect_resource"):
		consumer.collect_resource(val)  # val is from parent (default 1), override if required
		# TODO: *Some cool effect here*
