extends Control

func get_cards_by_scene_id(id: int) -> Array:
	var output:Array
	
	var scene = get_child(id)
	
	for i in range(scene.get_child_count()):
		output.append(scene.get_child(i))
		for note in output[i].get_children():
			if note is StickyNote:
				output[i].remove_child(note)
		
	for card in output:
		card.transform = Transform3D()
		for sticky_note in card.own_sticky_notes:
			sticky_note.transform = Transform3D()
	
	return output

func get_cards_by_name_array(names: Array) -> Dictionary:
	var output:Dictionary = {
		"cards": [],
		"sticky_notes": []
	}
	
	for scene in get_children():
		for card in scene.get_children():
			for sticky_note in card.get_children():
				if names.has(sticky_note.name):
					sticky_note.transform = Transform3D()
					output['sticky_notes'].append(sticky_note)
			
			if names.has(card.name):
				card.transform = Transform3D()
				output['cards'].append(card)
				for child in card.get_children():
					if child is StickyNote:
						child.reparent(self)
	return output
