mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Tournament game info -player names are listed beginning with the starting player.
This commit is contained in:
parent
9f7f938796
commit
8121849a18
3 changed files with 17 additions and 3 deletions
|
@ -291,4 +291,5 @@ public interface Game extends MageItem, Serializable {
|
|||
void pauseTimer(UUID playerId);
|
||||
int getPriorityTime();
|
||||
void setPriorityTime(int priorityTime);
|
||||
UUID getStartingPlayerId();
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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 = "";
|
||||
|
|
Loading…
Reference in a new issue