9var discovered_card_ids := []
13func mark_discovered(card_id) -> void:
15 if id !=
"" and not discovered_card_ids.has(id):
16 discovered_card_ids.append(id)
20func mark_cards_discovered(ids:Array) -> void:
26func mark_inventory_discovered(inventory_manager) -> void:
27 mark_cards_discovered(inventory_manager.get_card_ids())
31func has_discovered(card_id) -> bool:
32 return discovered_card_ids.has(str(card_id))
36func discovered_count() -> int:
37 return discovered_card_ids.size()
41func is_collection_complete(all_ids:Array) -> bool:
43 if str(id) !=
"" and not has_discovered(id):
45 return not all_ids.is_empty()
49func get_card_status(card_id, inventory_manager) -> String:
50 if inventory_manager.count_card(card_id) > 0:
52 if has_discovered(card_id):
58func get_state() -> Dictionary:
59 return {
"discovered_card_ids": discovered_card_ids.duplicate()}
63func apply_state(state:Dictionary) -> void:
64 discovered_card_ids.clear()
65 for id
in state.get(
"discovered_card_ids", []):