mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Fixed player names text building for tournament match info.
This commit is contained in:
parent
5bc89aadd0
commit
c8a48daed8
2 changed files with 6 additions and 32 deletions
|
@ -277,37 +277,12 @@ public abstract class MatchImpl implements Match {
|
||||||
StringBuilder playersInfo = new StringBuilder();
|
StringBuilder playersInfo = new StringBuilder();
|
||||||
int counter = 0;
|
int counter = 0;
|
||||||
|
|
||||||
Player currentPlayer = null;
|
for (MatchPlayer matchPlayer: getPlayers()) {
|
||||||
PlayerList playerList = game.getPlayerList();
|
if (counter > 0) {
|
||||||
if (game.getStartingPlayerId() != null) {
|
playersInfo.append(" - ");
|
||||||
playerList.setCurrent(game.getStartingPlayerId());
|
}
|
||||||
currentPlayer = game.getPlayer(game.getStartingPlayerId());
|
playersInfo.append(matchPlayer.getName());
|
||||||
}
|
counter++;
|
||||||
if (currentPlayer == null) {
|
|
||||||
currentPlayer = playerList.getCurrent(game);
|
|
||||||
}
|
|
||||||
if (currentPlayer != null) {
|
|
||||||
do {
|
|
||||||
if (counter > 0) {
|
|
||||||
playersInfo.append(" - ");
|
|
||||||
}
|
|
||||||
playersInfo.append(currentPlayer.getName());
|
|
||||||
counter++;
|
|
||||||
currentPlayer = game.getPlayer(playerList.getNext());
|
|
||||||
if (counter > 10) {
|
|
||||||
logger.error("Can't get no correct player info from game");
|
|
||||||
logger.debug("- matchId: " + this.getId());
|
|
||||||
logger.debug("- gameId: " + game.getId());
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
for (MatchPlayer matchPlayer:this.getPlayers()) {
|
|
||||||
sb.append(matchPlayer.getName()).append(" - " );
|
|
||||||
}
|
|
||||||
logger.debug("- players: " + sb.toString());
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} while(!currentPlayer.getId().equals(game.getStartingPlayerId()));
|
|
||||||
} else {
|
|
||||||
playersInfo.append("[got no players]");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String state;
|
String state;
|
||||||
|
|
|
@ -37,7 +37,6 @@ import java.util.Map;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
import mage.cards.Card;
|
|
||||||
import mage.cards.ExpansionSet;
|
import mage.cards.ExpansionSet;
|
||||||
import mage.cards.decks.Deck;
|
import mage.cards.decks.Deck;
|
||||||
import mage.constants.TournamentPlayerState;
|
import mage.constants.TournamentPlayerState;
|
||||||
|
|
Loading…
Reference in a new issue