@tool
class_name Entity extends CharacterBody3D
const UUID = preload("res://util/UUID.gd")

enum MovementType {
  NONE,
  DISABLED,
  PLAYER
}

enum InteractType {
  NONE,
  CONVERSATION,
  ONE_TIME_ITEM,
  CUTSCENE,
  BATTLE_TEST,
  PROXIMITY_CHATBOX,
}

@export_category("Identification")
@export var entityId:String = UUID.uuidv4()
@export_tool_button("Regenerate ID")
var button := func():
  entityId = UUID.uuidv4()

@export_category("Dialogue")
@export var dialogueName:String = ""
@export var displayName:String = ""

@export_category("Movement")
@export var movementType:MovementType = MovementType.NONE

@export_category("Interactions")
@export var interactType:InteractType = InteractType.NONE
@export var dialogueBasePath:String = ""
@export var dialogueTitle:String = "start"
@export var oneTimeItem:ItemResource = null
@export var cutscene:CutsceneResource = null

@export_category("Test Battle")

func _enter_tree() -> void:
  if Engine.is_editor_hint():
    return
  if dialogueName != "":
    OVERWORLD.registerDialogueEntity(self)

func _exit_tree() -> void:
  if Engine.is_editor_hint():
    return
  if dialogueName != "":
    OVERWORLD.unregisterDialogueEntity(self)
