From 5fc67ab5e5caf3541a0d73beeb7d525a602bbc7c Mon Sep 17 00:00:00 2001 From: Nathan Singer Date: Tue, 22 Apr 2025 19:02:26 -0400 Subject: [PATCH] documents the public facing function: --- card.gd | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/card.gd b/card.gd index 1ad0dfe..6804d96 100644 --- a/card.gd +++ b/card.gd @@ -25,9 +25,9 @@ func _init(id) -> void: card_id = id func _ready() -> void: - await do_cache_grab() + await _do_cache_grab() -func do_cache_grab() -> void: +func _do_cache_grab() -> void: await _do_http_request_card() await _do_http_request_imgs(png_path, true) await _do_http_request_imgs(jpg_path, false) @@ -97,9 +97,14 @@ func _do_http_request_card() -> void: png_path = image_uris["png"] jpg_path = image_uris["normal"] +## load_card +## +## Loads the card, returns false, and triggers +## a cache fetch if the card is not in the cache, +## otherwise sets the cards variables if the cache is present. func load_card() -> bool: if !_check_cache(card_id): - await do_cache_grab() + await _do_cache_grab() push_error(_card_error("CACHE_FAIL") + "Cache wasn't ready, this card will need to be reinitialized") return false