teijo / jquery-bracket

jQuery Bracket library for organizing single and double elimination tournaments
http://aropupu.fi/bracket/
MIT License
484 stars 253 forks source link

Overriding the function that defines the winner #46

Closed patricksamson closed 4 years ago

patricksamson commented 8 years ago

Hi, I'm trying to implement this for a fencing tournament, but ran into an issue. According to the rules, fencers can be disqualified. It implies that the score cannot be trusted by itself to declare a winner. I was wondering how I could redefine the function that declares the winner of a match.

Thanks!

teijo commented 8 years ago

There isn't currently a way to override the method of determining the winner without code changes.

Are the fencing tournaments single elimination? Does "disqualification" mean that you just lose that single match or are you dropped from the whole tournament in case it's double elimination?

patricksamson commented 8 years ago

It can be single or double elimination, depending on the chosen rules.

Disqualification can occur because of an injury, not showing up on time for the match or unsportsmanlike behaviour. The fencer is then dropped from that tournament.

There are however multiple tournaments happening at the same time. Each one has different weapons, rules and age groups, and a fencer can participate to more than one tournament.

Each match has a time constraint (depends on the rules and weapon, but usually 2 periods of 3 minutes), so it is very possible to end in a tie, and other parameters are then taken into account to determine a winner. In my case, this will be done server-side, and your plugin will only be used to display the results graphically. I'll try to come up with something and send a PR your way :)

teijo commented 8 years ago

Dropping from tournament is kinda related to non-2-power-number of participants as there needs to be some way to give default wins for participants who would've encountered the now-disqualified participant.

Are there additional rules regarding default loss/win?

patricksamson commented 8 years ago

Not really, but as I said all that "winner" logic is handled server side, so I already know which one of the two is the winner (the referees enter it in their phones). The dropped fencer will still show up in the bracket because points scored and points awarded are still important.

sawan1990 commented 6 years ago

I think we need this feature, as I am doing it for other sports where 90% of times score matter but 10% of the time winner is not related to score other factors are considered.

teijo commented 6 years ago

winner is not related to score other factors are considered

@sawan1990 interesting, can you give a few exmaples

sawan1990 commented 6 years ago

In taekwondo we can have win due to punishment and sudden death where points does not matter. So there are lot of cases where player have higher points but lost due to punishment or sudsen death.

kwiatekp commented 6 years ago

There are some sports that just determine looser and winner without points like in Drift twin battles, so possibility to just asign i.e. true and false to determine a winner would be a great enchancement.