diff --git a/components/prize_pool/wikis/ageofempires/prize_pool_award_custom.lua b/components/prize_pool/wikis/ageofempires/prize_pool_award_custom.lua index 29484fae80f..9d5c4b237e5 100644 --- a/components/prize_pool/wikis/ageofempires/prize_pool_award_custom.lua +++ b/components/prize_pool/wikis/ageofempires/prize_pool_award_custom.lua @@ -22,6 +22,8 @@ local IS_AWARD = true local PRIZE_TYPE_POINTS = 'POINTS' -- Template entry point +---@param frame Frame +---@return Html function CustomAwardPrizePool.run(frame) local args = Arguments.getArgs(frame) args.localcurrency = args.localcurrency or Variables.varDefault('tournament_currency') @@ -38,6 +40,10 @@ function CustomAwardPrizePool.run(frame) return awardsPrizePool:build(IS_AWARD) end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.extradata.patch = Variables.varDefault('tournament_patch') diff --git a/components/prize_pool/wikis/ageofempires/prize_pool_custom.lua b/components/prize_pool/wikis/ageofempires/prize_pool_custom.lua index d8c24527813..9d0f84f6df5 100644 --- a/components/prize_pool/wikis/ageofempires/prize_pool_custom.lua +++ b/components/prize_pool/wikis/ageofempires/prize_pool_custom.lua @@ -30,6 +30,8 @@ local QUALIFIER = 'Qualifier' local TIER_VALUE = {10, 6, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) args.syncPlayers = true @@ -43,6 +45,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -88,6 +94,11 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@param type string? +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place, type) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/apexlegends/prize_pool_custom.lua b/components/prize_pool/wikis/apexlegends/prize_pool_custom.lua index 56fedb6a1ed..085b5c9a4fc 100644 --- a/components/prize_pool/wikis/apexlegends/prize_pool_custom.lua +++ b/components/prize_pool/wikis/apexlegends/prize_pool_custom.lua @@ -21,6 +21,8 @@ local CustomPrizePool = {} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -30,6 +32,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = Weight.calc( lpdbData.prizemoney, diff --git a/components/prize_pool/wikis/apexlegends/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/apexlegends/prize_pool_legacy_custom.lua index acf0fc92780..a8a053d9791 100644 --- a/components/prize_pool/wikis/apexlegends/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/apexlegends/prize_pool_legacy_custom.lua @@ -12,12 +12,17 @@ local Lua = require('Module:Lua') local PrizePoolLegacy = Lua.import('Module:PrizePool/Legacy') local CustomLegacyPrizePool = {} --- Template entry point +-- Template entry point +---@return Html function CustomLegacyPrizePool.run() return PrizePoolLegacy.run(CustomLegacyPrizePool) end +---@param newArgs table +---@param data table +---@param header table +---@return table function CustomLegacyPrizePool.customHeader(newArgs, data, header) if Logic.readBool(header.seed) then PrizePoolLegacy.assignType(newArgs, 'seed', 'seed') diff --git a/components/prize_pool/wikis/arenaofvalor/prize_pool_custom.lua b/components/prize_pool/wikis/arenaofvalor/prize_pool_custom.lua index 20953a58974..42f8766fe69 100644 --- a/components/prize_pool/wikis/arenaofvalor/prize_pool_custom.lua +++ b/components/prize_pool/wikis/arenaofvalor/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 3, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -31,6 +33,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -46,6 +52,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/brawlstars/prize_pool_custom.lua b/components/prize_pool/wikis/brawlstars/prize_pool_custom.lua index 72068660762..15779e3d112 100644 --- a/components/prize_pool/wikis/brawlstars/prize_pool_custom.lua +++ b/components/prize_pool/wikis/brawlstars/prize_pool_custom.lua @@ -31,6 +31,8 @@ local TIER_VALUE = {16, 8, 4, 2, Monthly = 2} local TYPE_MODIFIER = {offline = 1, ['offline/online'] = 0.75, ['online/offline'] = 0.75, default = 0.65} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) @@ -48,6 +50,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, diff --git a/components/prize_pool/wikis/counterstrike/prize_pool_award_custom.lua b/components/prize_pool/wikis/counterstrike/prize_pool_award_custom.lua index 5def057a9b3..89878c22aa6 100644 --- a/components/prize_pool/wikis/counterstrike/prize_pool_award_custom.lua +++ b/components/prize_pool/wikis/counterstrike/prize_pool_award_custom.lua @@ -25,6 +25,8 @@ local IS_AWARD = true local HEADER_DATA = {} -- Template entry point +---@param frame Frame +---@return Html function CustomAwardPrizePool.run(frame) local args = Arguments.getArgs(frame) args.localcurrency = args.localcurrency or Variables.varDefault('tournament_currency') @@ -50,6 +52,10 @@ function CustomAwardPrizePool.run(frame) return awardsPrizePool:build(IS_AWARD) end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.extradata.scorename = HEADER_DATA.resultName lpdbData.tournament = HEADER_DATA.tournamentName or lpdbData.tournament diff --git a/components/prize_pool/wikis/counterstrike/prize_pool_custom.lua b/components/prize_pool/wikis/counterstrike/prize_pool_custom.lua index 58a7bca5ec3..50b2992875e 100644 --- a/components/prize_pool/wikis/counterstrike/prize_pool_custom.lua +++ b/components/prize_pool/wikis/counterstrike/prize_pool_custom.lua @@ -28,6 +28,8 @@ local TYPE_MODIFIER = {offline = 1, ['offline/online'] = 0.75, ['online/offline' local HEADER_DATA = {} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) @@ -62,6 +64,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) if not placement.specialStatuses.DQ.active(placement.args) then lpdbData.weight = CustomPrizePool.calculateWeight( diff --git a/components/prize_pool/wikis/counterstrike/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/counterstrike/prize_pool_legacy_custom.lua index 08c96a9c820..964b6c2fdd7 100644 --- a/components/prize_pool/wikis/counterstrike/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/counterstrike/prize_pool_legacy_custom.lua @@ -14,10 +14,15 @@ local PrizePoolLegacy = Lua.import('Module:PrizePool/Legacy') local CustomLegacyPrizePool = {} -- Template entry point +---@return Html function CustomLegacyPrizePool.run() return PrizePoolLegacy.run(CustomLegacyPrizePool) end +---@param newArgs table +---@param CACHED_DATA table +---@param header table +---@return table function CustomLegacyPrizePool.customHeader(newArgs, CACHED_DATA, header) newArgs.qualifier = header.qualifier newArgs['tournamentName'] = header['tournament name'] @@ -27,6 +32,10 @@ function CustomLegacyPrizePool.customHeader(newArgs, CACHED_DATA, header) return newArgs end +---@param newData table +---@param CACHED_DATA table +---@param slot table +---@return table function CustomLegacyPrizePool.customSlot(newData, CACHED_DATA, slot) -- Requested by CS so they can do cleanup of tables with incorrect data if newData.localprize then @@ -43,6 +52,11 @@ function CustomLegacyPrizePool.customSlot(newData, CACHED_DATA, slot) return newData end +---@param opponentData table +---@param CACHED_DATA table +---@param slot table +---@param opponentIndex integer +---@return table function CustomLegacyPrizePool.customOpponent(opponentData, CACHED_DATA, slot, opponentIndex) -- CS didn't support multiple points (etc), however they supported points (etc) per opponent @@ -64,6 +78,9 @@ function CustomLegacyPrizePool.customOpponent(opponentData, CACHED_DATA, slot, o return opponentData end +---@param opponentData table +---@param param string +---@param value string function CustomLegacyPrizePool._setOpponentReward(opponentData, param, value) if param == 'seed' then PrizePoolLegacy.handleSeed(opponentData, value, 1) diff --git a/components/prize_pool/wikis/dota2/prize_pool_award_custom.lua b/components/prize_pool/wikis/dota2/prize_pool_award_custom.lua index b1ea111873c..99796857f5d 100644 --- a/components/prize_pool/wikis/dota2/prize_pool_award_custom.lua +++ b/components/prize_pool/wikis/dota2/prize_pool_award_custom.lua @@ -21,6 +21,8 @@ local CustomAwardPrizePool = {} local IS_AWARD = true -- Template entry point +---@param frame Frame +---@return Html function CustomAwardPrizePool.run(frame) local args = Arguments.getArgs(frame) args.localcurrency = args.localcurrency or Variables.varDefault('tournament_currency') @@ -37,6 +39,10 @@ function CustomAwardPrizePool.run(frame) return awardsPrizePool:build(IS_AWARD) end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.extradata.series2 = Variables.varDefault('tournament_series2', '') diff --git a/components/prize_pool/wikis/dota2/prize_pool_custom.lua b/components/prize_pool/wikis/dota2/prize_pool_custom.lua index 8959837926d..7184ce90960 100644 --- a/components/prize_pool/wikis/dota2/prize_pool_custom.lua +++ b/components/prize_pool/wikis/dota2/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -31,6 +33,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -54,6 +60,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/dota2/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/dota2/prize_pool_legacy_custom.lua index 1b497f2a563..bc36a4de721 100644 --- a/components/prize_pool/wikis/dota2/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/dota2/prize_pool_legacy_custom.lua @@ -14,10 +14,15 @@ local PrizePoolLegacy = Lua.import('Module:PrizePool/Legacy') local CustomLegacyPrizePool = {} -- Template entry point +---@return Html function CustomLegacyPrizePool.run() return PrizePoolLegacy.run(CustomLegacyPrizePool) end +---@param newArgs table +---@param data table +---@param header table +---@return table function CustomLegacyPrizePool.customHeader(newArgs, data, header) newArgs.prizesummary = header.prizenote and true or newArgs.prizesummary diff --git a/components/prize_pool/wikis/formula1/prize_pool_custom.lua b/components/prize_pool/wikis/formula1/prize_pool_custom.lua index 36ae4cf5af9..ce852fea8fa 100644 --- a/components/prize_pool/wikis/formula1/prize_pool_custom.lua +++ b/components/prize_pool/wikis/formula1/prize_pool_custom.lua @@ -64,6 +64,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -73,6 +75,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -89,6 +95,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/fortnite/prize_pool_award_custom.lua b/components/prize_pool/wikis/fortnite/prize_pool_award_custom.lua index 2fd6ce7b97e..62cb956dea7 100644 --- a/components/prize_pool/wikis/fortnite/prize_pool_award_custom.lua +++ b/components/prize_pool/wikis/fortnite/prize_pool_award_custom.lua @@ -17,6 +17,8 @@ local CustomAwardPrizePool = {} local IS_AWARD = true -- Template entry point +---@param frame Frame +---@return Html function CustomAwardPrizePool.run(frame) local args = Arguments.getArgs(frame) args.localcurrency = args.localcurrency or Variables.varDefault('tournament_currency') diff --git a/components/prize_pool/wikis/fortnite/prize_pool_custom.lua b/components/prize_pool/wikis/fortnite/prize_pool_custom.lua index f1bcc59c128..ccfb54890f3 100644 --- a/components/prize_pool/wikis/fortnite/prize_pool_custom.lua +++ b/components/prize_pool/wikis/fortnite/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) args.localcurrency = args.localcurrency or Variables.varDefault('tournament_currency') @@ -32,6 +34,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -50,6 +56,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/fortnite/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/fortnite/prize_pool_legacy_custom.lua index 51c7ad76961..652e73c39e7 100644 --- a/components/prize_pool/wikis/fortnite/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/fortnite/prize_pool_legacy_custom.lua @@ -24,10 +24,15 @@ local _opponent_type local TBD = 'TBD' -- Template entry point +---@return Html function CustomLegacyPrizePool.run() return LegacyPrizePool.run(CustomLegacyPrizePool) end +---@param newArgs table +---@param CACHED_DATA table +---@param header table +---@return table function CustomLegacyPrizePool.customHeader(newArgs, CACHED_DATA, header) newArgs.prizesummary = false @@ -47,6 +52,8 @@ function CustomLegacyPrizePool.customHeader(newArgs, CACHED_DATA, header) return newArgs end +---@param slot table +---@return number function CustomLegacyPrizePool.opponentsInSlot(slot) local slotInputSize if slot.place and not SPECIAL_PLACES[string.lower(slot.place)] then @@ -64,6 +71,10 @@ function CustomLegacyPrizePool.opponentsInSlot(slot) return math.max(math.min(slotInputSize or math.huge, numberOfOpponentsFromInput), 1) end +---@param slot table +---@param newData table +---@param mergeSlots boolean +---@return table[] function CustomLegacyPrizePool.overwriteMapOpponents(slot, newData, mergeSlots) local mapOpponent = function (opponentIndex) local opponentData = CustomLegacyPrizePool._readOpponentArgs{ @@ -83,6 +94,8 @@ function CustomLegacyPrizePool.overwriteMapOpponents(slot, newData, mergeSlots) return opponents end +---@param props table +---@return table? function CustomLegacyPrizePool._readOpponentArgs(props) local slot = props.slot local opponentIndex = props.opponentIndex diff --git a/components/prize_pool/wikis/halo/prize_pool_custom.lua b/components/prize_pool/wikis/halo/prize_pool_custom.lua index f7e11a55a11..54337ef906b 100644 --- a/components/prize_pool/wikis/halo/prize_pool_custom.lua +++ b/components/prize_pool/wikis/halo/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) args.allGroupsUseWdl = true @@ -32,6 +34,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -50,6 +56,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/leagueoflegends/prize_pool_custom.lua b/components/prize_pool/wikis/leagueoflegends/prize_pool_custom.lua index 70ac0fed9c8..fe276688112 100644 --- a/components/prize_pool/wikis/leagueoflegends/prize_pool_custom.lua +++ b/components/prize_pool/wikis/leagueoflegends/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) args.allGroupsUseWdl = true @@ -32,6 +34,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -52,6 +58,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/leagueoflegends/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/leagueoflegends/prize_pool_legacy_custom.lua index d8051ff29c6..9bde96a4665 100644 --- a/components/prize_pool/wikis/leagueoflegends/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/leagueoflegends/prize_pool_legacy_custom.lua @@ -14,10 +14,15 @@ local PrizePoolLegacy = Lua.import('Module:PrizePool/Legacy') local CustomLegacyPrizePool = {} -- Template entry point +---@return Html function CustomLegacyPrizePool.run() return PrizePoolLegacy.run(CustomLegacyPrizePool) end +---@param newArgs table +---@param data table +---@param header table +---@return table function CustomLegacyPrizePool.customHeader(newArgs, data, header) newArgs.prizesummary = header.prizenote and true or newArgs.prizesummary diff --git a/components/prize_pool/wikis/mobilelegends/prize_pool_custom.lua b/components/prize_pool/wikis/mobilelegends/prize_pool_custom.lua index a6a57b5cab3..120019f0b97 100644 --- a/components/prize_pool/wikis/mobilelegends/prize_pool_custom.lua +++ b/components/prize_pool/wikis/mobilelegends/prize_pool_custom.lua @@ -22,6 +22,8 @@ local CustomPrizePool = {} local TIER_VALUE = {8, 4, 2} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -31,6 +33,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -50,6 +56,10 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place) if Logic.isEmpty(tier) then return 0 diff --git a/components/prize_pool/wikis/mobilelegends/prize_pool_legacy_custom.lua b/components/prize_pool/wikis/mobilelegends/prize_pool_legacy_custom.lua index 72eaf452787..1c967fafaa7 100644 --- a/components/prize_pool/wikis/mobilelegends/prize_pool_legacy_custom.lua +++ b/components/prize_pool/wikis/mobilelegends/prize_pool_legacy_custom.lua @@ -13,10 +13,16 @@ local PrizePoolLegacy = Lua.import('Module:PrizePool/Legacy') local CustomLegacyPrizePool = {} -- Template entry point +---@return Html function CustomLegacyPrizePool.run() return PrizePoolLegacy.run(CustomLegacyPrizePool) end +---@param opponentData table +---@param CACHED_DATA table +---@param slot table +---@param opponentIndex integer +---@return table function CustomLegacyPrizePool.customOpponent(opponentData, CACHED_DATA, slot, opponentIndex) -- ML has use case of same placement but has different earnings @@ -33,6 +39,9 @@ function CustomLegacyPrizePool.customOpponent(opponentData, CACHED_DATA, slot, o return opponentData end +---@param opponentData table +---@param param string +---@param value string function CustomLegacyPrizePool._setOpponentReward(opponentData, param, value) if param == 'seed' then PrizePoolLegacy.handleSeed(opponentData, value, 1) diff --git a/components/prize_pool/wikis/overwatch/prize_pool_custom.lua b/components/prize_pool/wikis/overwatch/prize_pool_custom.lua index 7f821f55f33..2a0f3f79249 100644 --- a/components/prize_pool/wikis/overwatch/prize_pool_custom.lua +++ b/components/prize_pool/wikis/overwatch/prize_pool_custom.lua @@ -26,6 +26,8 @@ local TYPE_MODIFIER = {Online = 0.65} local TIER_TYPE_MODIFIER = {Qualifier = 0.001} -- Template entry point +---@param frame Frame +---@return Html function CustomPrizePool.run(frame) local args = Arguments.getArgs(frame) local prizePool = PrizePool(args):create() @@ -35,6 +37,10 @@ function CustomPrizePool.run(frame) return prizePool:build() end +---@param lpdbData placement +---@param placement PrizePoolPlacement +---@param opponent BasePlacementOpponent +---@return placement function CustomLpdbInjector:adjust(lpdbData, placement, opponent) lpdbData.weight = CustomPrizePool.calculateWeight( lpdbData.prizemoney, @@ -56,6 +62,12 @@ function CustomLpdbInjector:adjust(lpdbData, placement, opponent) return lpdbData end +---@param prizeMoney number +---@param tier string? +---@param place integer +---@param type string? +---@param tierType string? +---@return integer function CustomPrizePool.calculateWeight(prizeMoney, tier, place, type, tierType) if Logic.isEmpty(tier) then return 0