extends MarginContainer

func _ready():
	$StatsColumn/FloorLabel.text = "FLOOR: 10"
	$StatsColumn/SavedLabel.text = "SAVED: 0"
	$StatsColumn/PeopleLabel.text = "PEOPLE: 0/2"
	$StatsColumn/ScoreLabel.text = "SCORE: 0"

	EventBus.floor_changed.connect(update_floor)
	EventBus.saved_changed.connect(update_saved)
	EventBus.people_changed.connect(update_people)
	EventBus.score_changed.connect(update_score)

func update_floor(floor_num: int):
	$StatsColumn/FloorLabel.text = "FLOOR: " + str(floor_num)

func update_saved(count: int):
	$StatsColumn/SavedLabel.text = "SAVED: " + str(count)

func update_people(count: int, threshold: int):
	$StatsColumn/PeopleLabel.text = "PEOPLE: " + str(count) + "/" + str(threshold)

func update_score(new_score: int):
	$StatsColumn/ScoreLabel.text = "SCORE: " + str(new_score)
