mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Tournament handling - small change to check who to eliminate.
This commit is contained in:
parent
15e3fd906e
commit
7318ecb50e
1 changed files with 5 additions and 2 deletions
|
@ -71,14 +71,17 @@ public class TournamentPairing {
|
|||
this.match = match;
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by eliminate tournaments after each match
|
||||
*/
|
||||
public void eliminatePlayers() {
|
||||
if (match.hasEnded()) {
|
||||
MatchPlayer mPlayer1 = match.getPlayer(player1.getPlayer().getId());
|
||||
MatchPlayer mPlayer2 = match.getPlayer(player2.getPlayer().getId());
|
||||
if (mPlayer1.hasQuit() || (!mPlayer2.hasQuit() && mPlayer1.getWins() < match.getWinsNeeded())) {
|
||||
if (mPlayer1.hasQuit() || !mPlayer1.isMatchWinner()) {
|
||||
player1.setEliminated();
|
||||
}
|
||||
if (mPlayer2.hasQuit() || (!mPlayer1.hasQuit() && mPlayer2.getWins() < match.getWinsNeeded())) {
|
||||
if (mPlayer2.hasQuit() || !mPlayer2.isMatchWinner()) {
|
||||
player2.setEliminated();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue