extends Interactable3D

const LAND_ICON = preload("res://common/icons/arrow-narrow-down.svg")

var run_point : RunPoint : set = set_run_point

@export var action_icon : TextureRect 
@export var action_label : Label 

func _ready():
    set_run_point()

func set_run_point(rp := run_point):
    run_point = rp
    if is_node_ready():
        action_icon.visible = rp != null
        action_label.visible = rp != null
        interactable = rp != null
        if rp:
            action_icon.texture = LAND_ICON
            action_label.text = rp.region_parameter.get_region_name()

func card_info() -> CardInfo:
    if run_point:
        return run_point.card_info()
    return null
