class_name QuestView extends Panel

const questor_template = preload("res://templates/questor_sprite.tscn")

@onready var questorSprite : QuestorSprite
@onready var setting = $Setting
var quest : Quest


func setup(qst : Quest) -> void:
	quest = qst
	quest.questview = self
	questorSprite = questor_template.instantiate()
	questorSprite.setup(quest.questor)
	add_child(questorSprite)
	questorSprite.global_position = $QuestorPosition.global_position


func set_questor_animation(anim_name : String) -> void:
	questorSprite.set_animation(anim_name)

func set_enemy_animation(enemy : Enemy, anim_name : String) -> void:
	enemy.set_animation(anim_name)

func place_enemy(enemy : Enemy) -> void:
	add_child(enemy)
	enemy.global_position = $EnemyPosition.global_position

func pause_setting() -> void:
	setting.process_mode = Node.PROCESS_MODE_DISABLED

func unpause_setting() -> void:
	setting.process_mode = Node.PROCESS_MODE_INHERIT
