Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(match2): Support the use of playall instead of bestof #5148

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

fregerson
Copy link
Collaborator

Summary

Attempted to create and store a new variable playall for Match Series that requires teams to play out a fixed number of games (instead of a bestof)

How did you test this change?

dev

@Rathoz
Copy link
Collaborator

Rathoz commented Nov 28, 2024

How commons would thise be? If it's only a few matches one can always set finished=false for the duration

@fregerson
Copy link
Collaborator Author

fregerson commented Nov 30, 2024

How commons would thise be? If it's only a few matches one can always set finished=false for the duration

Used for quite a number of recent non-official tournaments, we have not had the manpower to cover many of those, but thought it was something that could be used as an alternative for best of

Co-authored-by: Rikard Blixt <[email protected]>
Comment on lines +903 to +906
function MatchGroupInputUtil.allHasBeenPlayed(playall, opponents)
local scoreSum = Array.reduce(opponents, function(sum, opponent) return sum + (opponent.score or 0) end, 0)
return scoreSum >= playall
end
Copy link
Collaborator

@Rathoz Rathoz Dec 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function MatchGroupInputUtil.allHasBeenPlayed(playall, opponents)
local scoreSum = Array.reduce(opponents, function(sum, opponent) return sum + (opponent.score or 0) end, 0)
return scoreSum >= playall
end
function MatchGroupInputUtil.allHasBeenPlayed(games)
return Array.all(games, function(game) return game.finished end)
end

Wouldn't this do it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm you are right in this case then, shouldn't we just refactor playall to be a true/false variable, since the number of games for bestof is calculated by number of maps that are in the input?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not the case on all wikis fwiw

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm I mean like the use of PlayAll is currently only calculated if PlayAll is non-zero? And thus far this has no representation, for example, in making Ticker use {{Abbr/PaX}} instead of {{Abbr/BoX}}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the true/false version personally

Copy link
Collaborator Author

@fregerson fregerson Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it that way instead in the below commit

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah wait a second, breaks when no maps are provided :/

@fregerson
Copy link
Collaborator Author

Reverted to the proposal where playall is a boolean, and the bestof is used to determine how many games are played. Not sure if this is the direction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants