-
Notifications
You must be signed in to change notification settings - Fork 103
Expand file tree
/
Copy pathCustom.lua
More file actions
52 lines (43 loc) · 1.32 KB
/
Custom.lua
File metadata and controls
52 lines (43 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
---
-- @Liquipedia
-- page=Module:MatchGroup/Input/Custom
--
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--
local Lua = require('Module:Lua')
local FnUtil = Lua.import('Module:FnUtil')
local MatchGroupInputUtil = Lua.import('Module:MatchGroup/Input/Util')
local CustomMatchGroupInput = {}
---@class EvaMatchParser: MatchParserInterface
local MatchFunctions = {
DEFAULT_MODE = 'team',
getBestOf = MatchGroupInputUtil.getBestOf,
}
---@class EvaMapParser: MapParserInterface
local MapFunctions = {}
---@param match table
---@param options table?
---@return table
function CustomMatchGroupInput.processMatch(match, options)
return MatchGroupInputUtil.standardProcessMatch(match, MatchFunctions)
end
-- "Normal" match
---@param match table
---@param opponents MGIParsedOpponent[]
---@return table[]
function MatchFunctions.extractMaps(match, opponents)
return MatchGroupInputUtil.standardProcessMaps(match, opponents, MapFunctions)
end
---@param maps table[]
---@return fun(opponentIndex: integer): integer?
function MatchFunctions.calculateMatchScore(maps)
return FnUtil.curry(MatchGroupInputUtil.computeMatchScoreFromMapWinners, maps)
end
---@param match table
---@return table
function MatchFunctions.getExtraData(match)
return {
mapveto = MatchGroupInputUtil.getMapVeto(match),
}
end
return CustomMatchGroupInput