extends State
class_name BeeGathering

@export var animator : AnimationPlayer
@onready var bee = get_parent().get_parent() as Bee # I think this is bad but I dont care it works

var time_at_patch : float = 0.0

func enter(_msg := {}):
	Log.pr("I am going to attempt to gather some stuff!")
	bee.just_gathering = true
	#animator.play("Idle")

	#if !bee.in_range_of_flowers:
	#	## Go home bee, you're drunk
	#	state_transition.emit(self, "Idle")
	


func update(_delta : float):	

	if bee.in_range_of_flowers:
		#animator.play("Gathering")
		time_at_patch += _delta
		if time_at_patch > 5.0:
			bee.nectar += 1
			state_transition.emit(self, "Idle")
	else:
		state_transition.emit(self, "Idle")

