extends Node

var spots : Array

func _ready():
	spots = get_tree().get_nodes_in_group("spot")
	self.connect("spotChanged", self, "onAnySpotChanged")

func _process(_delta):
	for spot in spots:
		if spot.person == null:
			return
	get_tree().quit()

func onAnySpotChanged():
	for u_spot in spots:
		var spot : Spot = u_spot
		if spot.person.check_traits() == false:
			return
	get_tree().quit()
