class_name Interactable
extends Area2D

signal interacted(player: Player)

@export var auto_interact: bool = false

func interact(player: Player) -> void: 
	if !auto_interact:
		interacted.emit(player)


func _on_body_entered(body: Node2D) -> void:
	if auto_interact && body is Player:
		interacted.emit(body as Player)
