Test framework: added attached info in show command;

This commit is contained in:
Oleg Agafonov 2019-03-10 02:09:19 +04:00
parent 3d70dadc22
commit 886f3d39f8

View file

@ -712,7 +712,7 @@ public class TestPlayer implements Player {
// show battlefield
if (params[0].equals(SHOW_COMMAND_BATTLEFIELD) && params.length == 1) {
printStart(action.getActionName());
printPermanents(game.getBattlefield().getAllActivePermanents(computerPlayer.getId()));
printPermanents(game, game.getBattlefield().getAllActivePermanents(computerPlayer.getId()));
printEnd();
actions.remove(action);
wasProccessed = true;
@ -816,7 +816,7 @@ public class TestPlayer implements Player {
}
}
private void printPermanents(List<Permanent> cards) {
private void printPermanents(Game game, List<Permanent> cards) {
System.out.println("Total permanents: " + cards.size());
List<String> data = cards.stream()
@ -824,6 +824,7 @@ public class TestPlayer implements Player {
+ " - " + c.getPower().getValue()
+ "/" + c.getToughness().getValue()
+ ", " + (c.isTapped() ? "Tapped" : "Untapped")
+ (c.getAttachedTo() == null ? "" : ", attached to " + game.getPermanent(c.getAttachedTo()).getIdName())
))
.sorted()
.collect(Collectors.toList());