extends Node

@export var generator: WorldGenerator

@export var map: TileMap

var _progress_tracker: ProgressTracker = null


func _ready() -> void:
	self._progress_tracker = self.generator.get_progress_tracker()
	self._progress_tracker.progress_update.connect(self._on_progress)
	self.generator.generate(map)


func _on_progress() -> void:
	var status = self._progress_tracker.get_progress_data()
	print(
		(
			"%s (%s): %s"
			% [status.step_name, str(int(status.total_progress * 100.0)) + "%", status.message]
		)
	)
