mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
Changes to user / tournament / match handling.
This commit is contained in:
parent
ffa959d536
commit
eeb22c05ee
11 changed files with 55 additions and 50 deletions
|
|
@ -56,7 +56,7 @@ public interface Match {
|
|||
MatchPlayer getPlayer(UUID playerId);
|
||||
|
||||
void addPlayer(Player player, Deck deck);
|
||||
boolean leave(UUID playerId);
|
||||
boolean quitMatch(UUID playerId);
|
||||
|
||||
void submitDeck(UUID playerId, Deck deck);
|
||||
void updateDeck(UUID playerId, Deck deck);
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ public abstract class MatchImpl implements Match {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean leave(UUID playerId) {
|
||||
public boolean quitMatch(UUID playerId) {
|
||||
MatchPlayer mPlayer = getPlayer(playerId);
|
||||
if (mPlayer != null) {
|
||||
if (!hasStarted()) {
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ public class TournamentPairing {
|
|||
* Called by eliminate tournaments after each match
|
||||
*/
|
||||
public void eliminatePlayers() {
|
||||
if (match.hasEnded()) {
|
||||
if (match != null && match.hasEnded()) {
|
||||
MatchPlayer mPlayer1 = match.getPlayer(player1.getPlayer().getId());
|
||||
MatchPlayer mPlayer2 = match.getPlayer(player2.getPlayer().getId());
|
||||
if (mPlayer1.hasQuit() || !mPlayer1.isMatchWinner()) {
|
||||
|
|
@ -88,7 +88,7 @@ public class TournamentPairing {
|
|||
}
|
||||
}
|
||||
public void finishPlayersThatPlayedLastRound() {
|
||||
if (match.hasEnded()) {
|
||||
if (match != null && match.hasEnded()) {
|
||||
if (!player1.isEliminated()) {
|
||||
player1.setEliminated();
|
||||
player1.setState(TournamentPlayerState.FINISHED);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue