Skip to content

Commit

Permalink
as per review
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpalpha committed Dec 12, 2024
1 parent 91423f2 commit 4b6fc44
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ function MapFunctions.readMap(mapInput, opponentCount, hasScores)
end

map.opponents = Array.map(Array.range(1, opponentCount), function(opponentIndex)
return MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores)
return MapFunctions.getOpponentInfo(mapInput, opponentIndex)
end)

map.scores = Array.map(map.opponents, Operator.property('score'))
Expand Down Expand Up @@ -236,11 +236,10 @@ function MapFunctions.isFinished(mapInput, opponentCount, hasScores)
end)
end

---@param mapInput any
---@param opponentIndex any
---@param hasScores any
---@param mapInput table
---@param opponentIndex integer
---@return {placement: integer?, score: integer?, status: string}
function MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores)
function MapFunctions.getOpponentInfo(mapInput, opponentIndex)
local score, status = MatchGroupInputUtil.computeOpponentScore{
walkover = mapInput.walkover,
winner = mapInput.winner,
Expand All @@ -250,7 +249,7 @@ function MapFunctions.getOpponentInfo(mapInput, opponentIndex, hasScores)

return {
placement = tonumber(mapInput['placement' .. opponentIndex]),
score = hasScores and score or nil,
score = score,
status = status,
}
end
Expand Down

0 comments on commit 4b6fc44

Please sign in to comment.