Skip to content

Commit

Permalink
Commons Bestof, remove mvp and unsetmaps
Browse files Browse the repository at this point in the history
  • Loading branch information
Hesketh2 authored Dec 10, 2024
1 parent 71ae920 commit 32dafd3
Showing 1 changed file with 1 addition and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local MatchFunctions = {}
local MapFunctions = {}

MatchFunctions.DEFAULT_MODE = 'team'
MatchFunctions.getBestOf = MatchGroupInputUtil.getBestOf

---@param match table
---@param options table?
Expand All @@ -38,14 +39,6 @@ function MatchFunctions.extractMaps(match, opponents)
return MatchGroupInputUtil.standardProcessMaps(match, opponents, MapFunctions)
end

---@param games table[]
---@return table[]
function MatchFunctions.removeUnsetMaps(games)
return Array.filter(games, function(map)
return map.map ~= nil
end)
end

---@param maps table[]
---@return fun(opponentIndex: integer): integer?
function MatchFunctions.calculateMatchScore(maps)
Expand All @@ -54,24 +47,6 @@ function MatchFunctions.calculateMatchScore(maps)
end
end

---@param bestofInput string|integer?
---@return integer?
function MatchFunctions.getBestOf(bestofInput)
local bestof = tonumber(Logic.emptyOr(bestofInput, Variables.varDefault('bestof')))
Variables.varDefine('bestof', bestof)
return bestof or DEFAULT_BESTOF
end

---@param match table
---@param games table[]
---@param opponents table[]
---@return table
function MatchFunctions.getExtraData(match, games, opponents)
return {
mvp = MatchGroupInputUtil.readMvp(match, opponents),
}
end

--
-- map related functions
--
Expand Down

0 comments on commit 32dafd3

Please sign in to comment.