Tabnine Logo
DestroyAllNamedPermanentsEffect.getTargetPointer
Code IndexAdd Tabnine to your IDE (free)

How to use
getTargetPointer
method
in
mage.abilities.effects.common.DestroyAllNamedPermanentsEffect

Best Java code snippets using mage.abilities.effects.common.DestroyAllNamedPermanentsEffect.getTargetPointer (Showing top 1 results out of 315)

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
  if (targetPermanent == null) {
    return false;
  }
  FilterPermanent filter = new FilterPermanent();
  if (CardUtil.haveEmptyName(targetPermanent)) {
    filter.add(new PermanentIdPredicate(targetPermanent.getId()));  // if no name (face down creature) only the creature itself is selected
  } else {
    filter.add(new NamePredicate(targetPermanent.getName()));
  }
  for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), game)) {
    perm.destroy(source.getSourceId(), game, false);
  }
  return true;
}
mage.abilities.effects.commonDestroyAllNamedPermanentsEffectgetTargetPointer

Popular methods of DestroyAllNamedPermanentsEffect

  • <init>

Popular in Java

  • Parsing JSON documents to java classes using gson
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • scheduleAtFixedRate (Timer)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • System (java.lang)
    Provides access to system-related information and resources including standard input and output. Ena
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now