extends Node

@export var number_label: Label = null
@export var distance_label: Label = null
@export var time_label: Label = null
@export_file("*.tscn") var scene_path: String = ""


func _ready() -> void:
	var info: Globals.Track = Globals.get_current_track()
	number_label.text = "COURSE %d" % Globals.current_track
	distance_label.text = "%.1fkm" % [info.distance / 10000.0]
	time_label.text = "%d:%02d" % [info.time / 60.0, int(info.time) % 60]
	Music.stop()


func switch_scene() -> void:
	get_tree().change_scene_to_file(scene_path)
