mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Test framework: added command to show available mana;
This commit is contained in:
parent
90478932a3
commit
b3ec79f467
2 changed files with 22 additions and 2 deletions
|
@ -816,6 +816,15 @@ public class TestPlayer implements Player {
|
|||
wasProccessed = true;
|
||||
}
|
||||
|
||||
// show available mana
|
||||
if (params[0].equals(SHOW_COMMAND_AVAILABLE_MANA) && params.length == 1) {
|
||||
printStart(action.getActionName());
|
||||
printMana(game, computerPlayer.getManaAvailable(game));
|
||||
printEnd();
|
||||
actions.remove(action);
|
||||
wasProccessed = true;
|
||||
}
|
||||
|
||||
// show aliases
|
||||
if (params[0].equals(SHOW_COMMAND_ALIASES) && params.length == 1) {
|
||||
printStart(action.getActionName());
|
||||
|
@ -906,9 +915,14 @@ public class TestPlayer implements Player {
|
|||
}
|
||||
}
|
||||
|
||||
private void printMana(Game game, ManaOptions manaOptions) {
|
||||
System.out.println("Total mana options: " + manaOptions.size());
|
||||
manaOptions.forEach(mana -> {
|
||||
System.out.println(mana.toString());
|
||||
});
|
||||
}
|
||||
|
||||
private void printAbilities(Game game, List<Ability> abilities) {
|
||||
|
||||
|
||||
System.out.println("Total abilities: " + (abilities != null ? abilities.size() : 0));
|
||||
if (abilities == null) {
|
||||
return;
|
||||
|
|
|
@ -77,6 +77,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
public static final String SHOW_COMMAND_GRAVEYEARD = "GRAVEYARD";
|
||||
public static final String SHOW_COMMAND_EXILE = "EXILE";
|
||||
public static final String SHOW_COMMAND_AVAILABLE_ABILITIES = "AVAILABLE_ABILITIES";
|
||||
public static final String SHOW_COMMAND_AVAILABLE_MANA = "AVAILABLE_MANA";
|
||||
public static final String SHOW_COMMAND_ALIASES = "ALIASES";
|
||||
|
||||
// TODO: add target player param to commands
|
||||
|
@ -421,6 +422,10 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
show(showName, turnNum, step, player, SHOW_COMMAND_AVAILABLE_ABILITIES);
|
||||
}
|
||||
|
||||
public void showAvaileableMana(String showName, int turnNum, PhaseStep step, TestPlayer player) {
|
||||
show(showName, turnNum, step, player, SHOW_COMMAND_AVAILABLE_MANA);
|
||||
}
|
||||
|
||||
public void showAliases(String showName, int turnNum, PhaseStep step, TestPlayer player) {
|
||||
show(showName, turnNum, step, player, SHOW_COMMAND_ALIASES);
|
||||
}
|
||||
|
@ -1347,6 +1352,7 @@ public abstract class CardTestPlayerAPIImpl extends MageTestPlayerBase implement
|
|||
|
||||
public void castSpell(int turnNum, PhaseStep step, TestPlayer player, String cardName, Player target) {
|
||||
//Assert.assertNotEquals("", cardName);
|
||||
// warning, target in spell cast command setups without choose target call
|
||||
player.addAction(turnNum, step, "activate:Cast " + cardName + "$targetPlayer=" + target.getName());
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue