added specialized method getArtificialChoiceResults for MagicScryChoice to handle case where there is no cards in library
parent
79b858f3cb
commit
9984c56474
|
@ -12,12 +12,31 @@ import magic.ui.UndoClickedException;
|
|||
import magic.ui.choice.MayChoicePanel;
|
||||
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MagicScryChoice extends MagicMayChoice {
|
||||
public MagicScryChoice() {
|
||||
super("Put this card on the bottom of your library?");
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Object[]> getArtificialChoiceResults(
|
||||
final MagicGame game,
|
||||
final MagicEvent event,
|
||||
final MagicPlayer player,
|
||||
final MagicSource source) {
|
||||
|
||||
final MagicCard topCard = player.getLibrary().getCardAtTop();
|
||||
if (topCard == MagicCard.NONE) {
|
||||
final List<Object[]> choiceResultsList=new ArrayList<Object[]>();
|
||||
choiceResultsList.add(new Object[]{NO_CHOICE});
|
||||
return choiceResultsList;
|
||||
} else {
|
||||
return NO_OTHER_CHOICE_RESULTS;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] getPlayerChoiceResults(
|
||||
final GameController controller,
|
||||
|
|
Loading…
Reference in New Issue