forked from External/mage
refactor: improved usage of one time turn modifications (skip step, extra turn, etc)
This commit is contained in:
parent
4554fbc408
commit
8d938926b6
46 changed files with 222 additions and 190 deletions
|
|
@ -1041,7 +1041,7 @@ public abstract class GameImpl implements Game {
|
|||
|
||||
private boolean playExtraTurns() {
|
||||
//20091005 - 500.7
|
||||
TurnMod extraTurn = getNextExtraTurn();
|
||||
TurnMod extraTurn = useNextExtraTurn();
|
||||
try {
|
||||
while (extraTurn != null) {
|
||||
GameEvent event = new GameEvent(GameEvent.EventType.PLAY_TURN, null, null, extraTurn.getPlayerId());
|
||||
|
|
@ -1049,15 +1049,13 @@ public abstract class GameImpl implements Game {
|
|||
Player extraPlayer = this.getPlayer(extraTurn.getPlayerId());
|
||||
if (extraPlayer != null && extraPlayer.canRespond()) {
|
||||
state.setExtraTurnId(extraTurn.getId());
|
||||
if (!this.isSimulation()) {
|
||||
informPlayers(extraPlayer.getLogName() + " takes an extra turn");
|
||||
}
|
||||
informPlayers(extraPlayer.getLogName() + " takes an extra turn");
|
||||
if (!playTurn(extraPlayer)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
extraTurn = getNextExtraTurn();
|
||||
extraTurn = useNextExtraTurn();
|
||||
}
|
||||
} finally {
|
||||
state.setExtraTurnId(null);
|
||||
|
|
@ -1065,7 +1063,7 @@ public abstract class GameImpl implements Game {
|
|||
return true;
|
||||
}
|
||||
|
||||
private TurnMod getNextExtraTurn() {
|
||||
private TurnMod useNextExtraTurn() {
|
||||
boolean checkForExtraTurn = true;
|
||||
while (checkForExtraTurn) {
|
||||
TurnMod extraTurn = getState().getTurnMods().getNextExtraTurn();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue