forked from External/mage
Dev: added additional info to some classes for easy debug;
This commit is contained in:
parent
bde6222ea6
commit
0e916b6e29
19 changed files with 133 additions and 19 deletions
|
|
@ -21,6 +21,7 @@ import mage.filter.Filter;
|
|||
import mage.filter.predicate.mageobject.NamePredicate;
|
||||
import mage.game.CardState;
|
||||
import mage.game.Game;
|
||||
import mage.game.GameState;
|
||||
import mage.game.command.Commander;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
|
@ -1290,4 +1291,29 @@ public final class CardUtil {
|
|||
}
|
||||
return mapOldToNew;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return turn info for game. Uses in game logs and debug.
|
||||
*
|
||||
* @param game
|
||||
* @return
|
||||
*/
|
||||
public static String getTurnInfo(Game game) {
|
||||
return getTurnInfo(game == null ? null : game.getState());
|
||||
}
|
||||
|
||||
public static String getTurnInfo(GameState gameState) {
|
||||
// no turn info
|
||||
if (gameState == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// not started game
|
||||
if (gameState.getTurn().getStep() == null) {
|
||||
return "T0";
|
||||
}
|
||||
|
||||
// normal game
|
||||
return "T" + gameState.getTurnNum() + "." + gameState.getTurn().getStep().getType().getStepShortText();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue