From 2cc1b7f518be32673c070d426dec7b42359c32a9 Mon Sep 17 00:00:00 2001 From: Chr1Z93 Date: Thu, 22 Dec 2022 02:28:33 +0100 Subject: [PATCH] updated documentation --- src/arkhamdb/ArkhamDb.ttslua | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/arkhamdb/ArkhamDb.ttslua b/src/arkhamdb/ArkhamDb.ttslua index 90125816..e5761d9a 100644 --- a/src/arkhamdb/ArkhamDb.ttslua +++ b/src/arkhamdb/ArkhamDb.ttslua @@ -114,10 +114,10 @@ do -- passes to loadCards to actually spawn the defined deck. ---@param deck ArkhamImportDeck ---@param playerColor String Color name of the player mat to place this deck on (e.g. "Red") - ---@param loadNewest Boolean. Whether the newest version of this deck should be loaded - ---@param loadInvestigators Boolean. Whether investigator cards should be loaded as part of this + ---@param loadNewest Boolean Whether the newest version of this deck should be loaded + ---@param loadInvestigators Boolean Whether investigator cards should be loaded as part of this --- deck - ---@param callback Function. Callback which will be sent the results of this load. Parameters + ---@param callback Function Callback which will be sent the results of this load. Parameters --- to the callback will be: --- slots Table. A map of card ID to count in the deck --- investigatorCode String. ID of the investigator in this deck @@ -160,7 +160,9 @@ do -- get upgrades for customizable cards local meta = deck.meta local customizations = {} - if meta then customizations = JSON.decode(deck.meta) end + if meta then + customizations = JSON.decode(meta) + end callback(slots, deck.investigator_code, bondList, customizations, playerColor) end @@ -168,9 +170,9 @@ do -- Checks to see if the slot list includes the random weakness ID. If it does, -- removes it from the deck and replaces it with the ID of a random basic weakness provided by the -- all cards bag - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number --- of those cards which will be spawned - ---@param playerColor Color name of the player this deck is being loaded for. Used for broadcast + ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast --- if a weakness is added. internal.maybeDrawRandomWeakness = function(slots, playerColor) local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) @@ -190,8 +192,8 @@ do end -- Adds both the investigator (XXXXX) and minicard (XXXXX-m) slots with one copy each - ---@param deck The processed ArkhamDB deck response - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the + ---@param deck Table The processed ArkhamDB deck response + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the --- number of those cards which will be spawned internal.addInvestigatorCards = function(deck, slots) local investigatorId = deck.investigator_code @@ -215,7 +217,7 @@ do end -- Process the card list looking for the customizable cards, and add their upgrade sheets if needed - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number -- of those cards which will be spawned internal.maybeAddCustomizeUpgradeSheets = function(slots) local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) @@ -230,7 +232,7 @@ do -- Process the card list looking for the Summoned Servitor, and add its minicard to the list if -- needed - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number -- of those cards which will be spawned internal.maybeAddSummonedServitor = function(slots) if slots["09080"] ~= nil then @@ -240,9 +242,9 @@ do -- On the Mend should have 1-per-investigator copies set aside, but ArkhamDB always sends 1. Update -- the count based on the investigator count - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number -- of those cards which will be spawned - ---@param playerColor Color name of the player this deck is being loaded for. Used for broadcast if an error occurs + ---@param playerColor String Color of the player this deck is being loaded for. Used for broadcast if an error occurs internal.maybeAddOnTheMend = function(slots, playerColor) if slots["09006"] ~= nil then local investigatorCount = playAreaApi.getInvestigatorCount() @@ -256,7 +258,7 @@ do end -- Process the slot list and looks for any cards which are bonded to those in the deck. Adds those cards to the slot list. - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned internal.extractBondedCards = function(slots) local allCardsBag = getObjectFromGUID(configuration.card_bag_guid) -- Create a list of bonded cards first so we don't modify slots while iterating @@ -281,8 +283,8 @@ do end -- Check the deck for cards on its taboo list. If they're found, replace the entry in the slot with the Taboo id (i.e. "XXXX" becomes "XXXX-t") - ---@param tabooId The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used - ---@param slots The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned + ---@param tabooId String The deck's taboo ID, taken from the deck response taboo_id field. May be nil, indicating that no taboo list should be used + ---@param slots Table The slot list for cards in this deck. Table key is the cardId, value is the number of those cards which will be spawned internal.checkTaboos = function(tabooId, slots, playerColor) if tabooId then local allCardsBag = getObjectFromGUID(configuration.card_bag_guid)