-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'remove-some-resulttype-usage' into kick-participants
- Loading branch information
Showing
48 changed files
with
376 additions
and
397 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
-- @Liquipedia | ||
-- wiki=commons | ||
-- page=Module:MatchOpponentHelper | ||
-- | ||
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute | ||
-- | ||
|
||
local Array = require('Module:Array') | ||
|
||
|
||
local MatchOpponentHelper = {} | ||
|
||
MatchOpponentHelper.STATUS = { | ||
SCORE = 'S', | ||
FORFEIT = 'FF', | ||
DISQUALIFIED = 'DQ', | ||
LOSS = 'L', | ||
WIN = 'W', | ||
} | ||
|
||
---@param opponents table[] | ||
---@return string? | ||
function MatchOpponentHelper.calculateWalkoverType(opponents) | ||
return (Array.find(opponents or {}, function(opponent) | ||
return opponent.status == MatchOpponentHelper.STATUS.FORFEIT | ||
or opponent.status == MatchOpponentHelper.STATUS.DISQUALIFIED | ||
or opponent.status == MatchOpponentHelper.STATUS.LOSS | ||
end) or {}).status | ||
end | ||
|
||
|
||
|
||
return MatchOpponentHelper |
Oops, something went wrong.