extends BaseState
class_name PlayerPlayAnimationState

signal PlayAnimation(animation_name: String)
signal AnimationFinished(animation_name: String)

var current_animation_name: String

# Public Methods
func GetAnimationBaseName() -> String:
	return "idle"


func GetStateEnum() -> PlayerStateMachine.States:
	return PlayerStateMachine.States.PLAY_ANIMATION


func Enter(_extra_parameters: Dictionary) -> void:
	current_animation_name = _extra_parameters["animation_name"]
	print("Playing Player Animation State: [%s]" % current_animation_name)
	PlayAnimation.emit(current_animation_name)


func Exit() -> void:
	current_animation_name = ''


func OnAnimationFinished(animation_name: String) -> void:
	if animation_name != current_animation_name: return
	AnimationFinished.emit(animation_name)
