mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Some additions to game log.
This commit is contained in:
parent
3fcb222201
commit
089fbf15b1
1 changed files with 21 additions and 17 deletions
|
@ -572,23 +572,7 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean playTurn(Player player) {
|
private boolean playTurn(Player player) {
|
||||||
StringBuilder sb = new StringBuilder("Turn ");
|
this.logStartOfTurn(player);
|
||||||
sb.append(state.getTurnNum()).append(" (");
|
|
||||||
int delimiter = this.getPlayers().size() - 1;
|
|
||||||
for (Player gamePlayer : this.getPlayers().values()) {
|
|
||||||
sb.append(gamePlayer.getLife());
|
|
||||||
int poison = gamePlayer.getCounters().getCount(CounterType.POISON);
|
|
||||||
if (poison > 0) {
|
|
||||||
sb.append("[P:").append(poison).append("]");
|
|
||||||
}
|
|
||||||
if (delimiter > 0) {
|
|
||||||
sb.append(" - ");
|
|
||||||
delimiter--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
sb.append(")");
|
|
||||||
fireStatusEvent(sb.toString(), true);
|
|
||||||
|
|
||||||
if (checkStopOnTurnOption()) {
|
if (checkStopOnTurnOption()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -604,6 +588,26 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private void logStartOfTurn(Player player) {
|
||||||
|
StringBuilder sb = new StringBuilder("Turn ").append(state.getTurnNum()).append(" ");
|
||||||
|
sb.append(player.getName());
|
||||||
|
sb.append(" (");
|
||||||
|
int delimiter = this.getPlayers().size() - 1;
|
||||||
|
for (Player gamePlayer : this.getPlayers().values()) {
|
||||||
|
sb.append(gamePlayer.getLife());
|
||||||
|
int poison = gamePlayer.getCounters().getCount(CounterType.POISON);
|
||||||
|
if (poison > 0) {
|
||||||
|
sb.append("[P:").append(poison).append("]");
|
||||||
|
}
|
||||||
|
if (delimiter > 0) {
|
||||||
|
sb.append(" - ");
|
||||||
|
delimiter--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sb.append(")");
|
||||||
|
fireStatusEvent(sb.toString(), true);
|
||||||
|
}
|
||||||
|
|
||||||
private boolean checkStopOnTurnOption() {
|
private boolean checkStopOnTurnOption() {
|
||||||
if (gameOptions.stopOnTurn != null && gameOptions.stopAtStep == PhaseStep.UNTAP) {
|
if (gameOptions.stopOnTurn != null && gameOptions.stopAtStep == PhaseStep.UNTAP) {
|
||||||
if (gameOptions.stopOnTurn.equals(state.getTurnNum())) {
|
if (gameOptions.stopOnTurn.equals(state.getTurnNum())) {
|
||||||
|
|
Loading…
Reference in a new issue