Skip to content

Commit

Permalink
add inteface
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Nov 5, 2024
1 parent 1bd926e commit 6cb9b1e
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/match2/commons/match_group_input_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1077,6 +1077,15 @@ function MatchGroupInputUtil.mergeStandaloneIntoMatch(match, standaloneMatch)
return match
end

---@class MatchParserInterface
---@field extractMaps fun(match: table, opponents: table[]): table[]
---@field getBestOf fun(bestOfInput: string|integer, maps: table[]): integer
---@field calculateMatchScore fun(maps: table[]): fun(opponentIndex: integer): integer
---@field removeUnsetMaps? fun(maps: table[]): table[]
---@field getExtraData? fun(match: table, games: table[], opponents: table[]): table
---@field DEFAULT_MODE? string
---@field DATE_FALLBACKS? string[]
---@field OPPONENT_CONFIG? readOpponentOptions

--- The standard way to process a match input.
---
Expand All @@ -1094,7 +1103,7 @@ end
--- - DATE_FALLBACKS: string[]
--- - OPPONENT_CONFIG: table
---@param match table
---@param Parser any
---@param Parser MatchParserInterface
---@return table
function MatchGroupInputUtil.standardProcessMatch(match, Parser)
local finishedInput = match.finished --[[@as string?]]
Expand Down

0 comments on commit 6cb9b1e

Please sign in to comment.