class_name LevelTransition
extends Interactable

## Things like 'door_right', 'stairs' 
## helps the Player object pick an appropriate animation
export var _transition_type := 'door_right'
#export var _destination_level_name: String
export(String, FILE, "*.tscn") var _destination_level
#export var _foo: FileDialog
export var _destination_position_name := 'PlayerStart'
# Declare member variables here. Examples:
# var a = 2
# var b = "text"

##TODO: I'd really like to verify the pact scene is a level but I can't until its instanced.
#func _ready():
#	print(_destination_level.)

#	print(_destination_level.get_state(), _destination_level.get_class() , _destination_level.get_state().get_node_type(1))
#	print_debug(_destination_level._bundled)
#
#	assert(_destination_level.get_state().get_node_type(0) == 'Level')


func trigger_interaction():
	# This is something that should maybe be extended for every differant interactible.
	# They could inherit from this base class and implement this function. 
	print("Okay, I'll transition the level now!")
	#LevelInfo.change_level(_destination_level_name, _destination_position_name)
	LevelInfo.change_level(_destination_level, _destination_position_name)
