congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
Cards.isEmpty
Code IndexAdd Tabnine to your IDE (free)

How to use
isEmpty
method
in
mage.cards.Cards

Best Java code snippets using mage.cards.Cards.isEmpty (Showing top 20 results out of 315)

origin: magefree/mage

@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
  Player controller = game.getPlayer(controllerId);
  if (controller != null) {
    return !controller.getHand().isEmpty();
  }
  return false;
}
origin: magefree/mage

@Override
public boolean canPay(Ability ability, UUID sourceId, UUID controllerId, Game game) {
  Player controller = game.getPlayer(controllerId);
  return (controller != null
      && !controller.getHand().isEmpty());
}
origin: magefree/mage

@Override
public Card discardOne(boolean random, Ability source, Game game) {
  Cards cards = discard(1, random, source, game);
  if (cards.isEmpty()) {
    return null;
  }
  return cards.getRandom(game);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  return game.getPlayer(source.getControllerId()).getHand().isEmpty();
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  return game.getPlayer(game.getActivePlayerId()).getHand().isEmpty();
}
origin: magefree/mage

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getPlayerId().equals(source.getControllerId())) {
      Player player = game.getPlayer(event.getPlayerId());
      if(player != null) {
        if (player.getHand().isEmpty()) {
          return true;
        }
      }
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean applies(Permanent permanent, Ability source, Game game) {
  if (permanent.getId().equals(source.getSourceId())) {
    for (Player player : game.getPlayers().values()) {
      if (player != null && player.getHand().isEmpty()) {
        return false;
      }
    }
    return true;
  }
  // don't apply for all other creatures!
  return false;
}
origin: magefree/mage

@Override
public boolean chooseTarget(Outcome outcome, Cards cards, TargetCard target, Ability source, Game game) {
  if (cards.isEmpty()) {
    return !target.isRequired(source);
  }
  Card card = cards.getRandom(game);
  if (card != null) {
    target.addTarget(card.getId(), source, game);
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  for (UUID playerId : game.getState().getPlayersInRange(controllerId, game)) {
    Player player = game.getPlayer(playerId);
    if (player != null
        && player.getHand().isEmpty()) {
      return true;
    }
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    boolean result = false;

    Set<UUID> opponents = game.getOpponents(source.getControllerId());
    for (UUID opponentId : opponents) {
      result |= game.getPlayer(opponentId).getHand().isEmpty();
    }

    return result;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      Cards cards = controller.discard(1, false, source, game);
      if (!cards.isEmpty()) {
        controller.drawCards(1, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean applies(Ability abilityToModify, Ability source, Game game) {
  if (abilityToModify.getSourceId().equals(source.getSourceId())) {
    for (UUID playerId : game.getOpponents(source.getControllerId())) {
      Player opponent = game.getPlayer(playerId);
      if (opponent != null && opponent.getHand().isEmpty()) {
        return true;
      }
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean checkTrigger(GameEvent event, Game game) {
  if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
    Player opponent = game.getPlayer(event.getPlayerId());
    if (opponent != null && opponent.getHand().isEmpty()) {
      opponent.loseLife(2, game, false);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source));
    if (attacker != null) {
      if (!attacker.getHand().isEmpty() && attacker.chooseUse(outcome, "Discard a card and draw a card?", source, game)){
        attacker.discard(1, false, source, game);
        attacker.drawCards(1, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

@Override
public ManaCosts getManaCostToPay(GameEvent event, Ability source, Game game) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null && !controller.getHand().isEmpty()) {
    ManaCosts manaCosts = new ManaCostsImpl();
    manaCosts.add(new GenericManaCost(controller.getHand().size()));
    return manaCosts;
  }
  return null;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(targetPointer.getFirst(game, source));
  if (player != null && !player.getHand().isEmpty()) {
    Cards revealed = new CardsImpl();
    revealed.add(player.getHand().getRandom(game));
    player.revealCards("Merfolk Spy", revealed, game);
    return true;
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(targetPointer.getFirst(game, source));
  if (player != null && !player.getHand().isEmpty()) {
    Cards revealed = new CardsImpl();
    revealed.add(player.getHand().getRandom(game));
    player.revealCards("Hired Torturer", revealed, game);
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Permanent thoughtGorger = game.getPermanent(source.getSourceId());
    if (player != null && !player.getHand().isEmpty() && thoughtGorger != null ) {
      int cardsInHand = player.getHand().size();
      thoughtGorger.addCounters(CounterType.P1P1.createInstance(cardsInHand), source, game);
      player.discard(cardsInHand, false, source, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  private void chooseCardInHandAndPutOnTopOfLibrary(Game game, Ability source, Player you, Player targetPlayer) {
    if (!targetPlayer.getHand().isEmpty()) {
      TargetCard target = new TargetCard(Zone.HAND, new FilterCard("card to put on the top of library (last chosen will be on top)"));
      if (you.choose(Outcome.Benefit, targetPlayer.getHand(), target, game)) {
        Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
        if (card != null) {
          targetPlayer.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
        }
      }
    }
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      Cards cardsToExile = new CardsImpl(getTargetPointer().getTargets(game, source));
      controller.moveCards(cardsToExile, Zone.EXILED, source, game);
      if (!cardsToExile.isEmpty()) {
        new ZombieToken().putOntoBattlefield(cardsToExile.size(), game, source.getSourceId(), controller.getId());
      }
      return true;
    }
    return false;
  }
}
mage.cardsCardsisEmpty

Popular methods of Cards

  • getCards
  • size
  • add
  • clear
  • count
  • getRandom
  • addAll
  • contains
  • copy
  • get
  • iterator
  • remove
  • iterator,
  • remove,
  • removeAll,
  • toArray,
  • <init>,
  • getUniqueCards,
  • getValue,
  • stream

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Best plugins for Eclipse
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