extends BaseState

@onready var player: PlayerCharacter = $"../../.."
@onready var facing_direction_component: FacingDirectionComponent = $"../../../Components/FacingDirectionComponent"

func GetAnimationBaseName() -> String:
	return "idle"


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


func Enter(extra_parameters: Dictionary) -> void:
	var pos := extra_parameters["pos"] as Vector2
	var dir := extra_parameters["dir"] as Enums.Directions
	
	player.position = pos
	facing_direction_component.SetDirectionManually(dir)


func Update(_delta: float) -> void:
	if Input.is_action_just_pressed("player_interact"):
		player.position = Vector2(player.position.x, player.position.y + 16)
		state_machine.QueueStateChange(PlayerStateMachine.States.IDLE)
