package mage.utils.testers; import mage.abilities.Ability; import mage.game.Game; import mage.players.Player; import mage.util.DebugUtil; import java.util.ArrayList; import java.util.Arrays; import java.util.List; /** * Part of testable game dialogs *
* Its simple dialog to get some amount (example: part of chooseTargetAmount) *
* Supported methods:
* - player.getAmount()
*
* @author JayDi85
*/
class GetAmountTestableDialog extends BaseTestableDialog {
boolean isYou; // who choose - you or opponent
int min;
int max;
public GetAmountTestableDialog(boolean isYou, int min, int max) {
super(String.format("player.getAmount(%s)", isYou ? "you" : "AI"),
String.format("from %d to %d", min, max),
"",
new AmountTestableResult()
);
this.isYou = isYou;
this.min = min;
this.max = max;
}
@Override
public void showDialog(Player player, Ability source, Game game, Player opponent) {
Player choosingPlayer = this.isYou ? player : opponent;
String message = "message with html";
String chooseDebugSource = DebugUtil.getMethodNameWithSource(0, "class");
int chooseRes = choosingPlayer.getAmount(this.min, this.max, message, source, game);
List