* Tournament game info -player names are listed beginning with the starting player.

This commit is contained in:
LevelX2 2014-10-05 16:35:08 +02:00
parent 9f7f938796
commit 8121849a18
3 changed files with 17 additions and 3 deletions

View file

@ -291,4 +291,5 @@ public interface Game extends MageItem, Serializable {
void pauseTimer(UUID playerId);
int getPriorityTime();
void setPriorityTime(int priorityTime);
UUID getStartingPlayerId();
}

View file

@ -2456,4 +2456,10 @@ public abstract class GameImpl implements Game, Serializable {
public void setPriorityTime(int priorityTime) {
this.priorityTime = priorityTime;
}
@Override
public UUID getStartingPlayerId() {
return startingPlayerId;
}
}

View file

@ -44,6 +44,7 @@ import mage.game.events.TableEvent;
import mage.game.events.TableEvent.EventType;
import mage.game.events.TableEventSource;
import mage.players.Player;
import mage.players.PlayerList;
import mage.util.DateFormat;
import org.apache.log4j.Logger;
@ -275,13 +276,19 @@ public abstract class MatchImpl implements Match {
public GameInfo createGameInfo(Game game) {
StringBuilder playersInfo = new StringBuilder();
int counter = 0;
for(MatchPlayer matchPlayer: players) {
PlayerList playerList = game.getPlayerList();
playerList.setCurrent(game.getStartingPlayerId());
Player currentPlayer = game.getPlayer(game.getStartingPlayerId());
do {
if (counter > 0) {
playersInfo.append(" - ");
}
playersInfo.append(matchPlayer.getName());
playersInfo.append(currentPlayer.getName());
counter++;
}
currentPlayer = game.getPlayer(playerList.getNext());
} while(!currentPlayer.getId().equals(game.getStartingPlayerId()));
String state;
String result;
String duelingTime = "";