mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +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;
|
this.match = match;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called by eliminate tournaments after each match
|
||||||
|
*/
|
||||||
public void eliminatePlayers() {
|
public void eliminatePlayers() {
|
||||||
if (match.hasEnded()) {
|
if (match.hasEnded()) {
|
||||||
MatchPlayer mPlayer1 = match.getPlayer(player1.getPlayer().getId());
|
MatchPlayer mPlayer1 = match.getPlayer(player1.getPlayer().getId());
|
||||||
MatchPlayer mPlayer2 = match.getPlayer(player2.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();
|
player1.setEliminated();
|
||||||
}
|
}
|
||||||
if (mPlayer2.hasQuit() || (!mPlayer1.hasQuit() && mPlayer2.getWins() < match.getWinsNeeded())) {
|
if (mPlayer2.hasQuit() || !mPlayer2.isMatchWinner()) {
|
||||||
player2.setEliminated();
|
player2.setEliminated();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue