Codota Logo
Cards.get
Code IndexAdd Codota to your IDE (free)

How to use
get
method
in
mage.cards.Cards

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: magefree/mage

  @Override
  public boolean canTarget(UUID id, Cards cards, Game game) {
    Card card = cards.get(id, game);
    if (card != null) {
      return filter.match(card, game);
    }
    return false;
  }
}
origin: magefree/mage

public static List<Card> chooseOrder(String message, Cards cards, Player player, Game game) {
  List<Card> order = new ArrayList<>();
  TargetCard target = new TargetCard(Zone.ALL, new FilterCard(message));
  target.setRequired(true);
  while (player.isInGame() && cards.size() > 1) {
    player.choose(Outcome.Neutral, cards, target, game);
    UUID targetObjectId = target.getFirstTarget();
    order.add(cards.get(targetObjectId, game));
    cards.remove(targetObjectId);
    target.clearChosen();
  }
  order.add(cards.getCards(game).iterator().next());
  return order;
}
origin: magefree/mage

public boolean canTarget(UUID id, Cards cards, Game game) {
  Card card = cards.get(id, game);
  return card != null && filter.match(card, game);
}
origin: magefree/mage

@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  Player player = game.getPlayer(controllerId);
  if (player != null) {
    Card card = player.getHand().get(sourceId, game);
    if (card != null) {
      paid = player.discard(card, null, game);
    }
  }
  return paid;
}
origin: magefree/mage

@Override
public boolean canTarget(UUID playerId, UUID id, Ability source, Game game) {
  Card card = game.getPlayer(playerId).getHand().get(id, game);
  return card != null && filter.match(card, source.getSourceId(), playerId, game);
}
origin: magefree/mage

@Override
public boolean canTarget(UUID id, Ability source, Game game) {
  Card card = game.getPlayer(playerId).getHand().get(id, game);
  return card != null && filter.match(card, source.getControllerId(), game);
}
origin: magefree/mage

  @Override
  public boolean canTarget(UUID id, Cards cards, Game game) {
    Card card = cards.get(id, game);
    if (card != null) {
      for (UUID targetId : this.getTargets()) {
        Card iCard = game.getCard(targetId);
        if (iCard != null && iCard.getName().equals(card.getName())) {
          return false;
        }
      }
      return filter.match(card, game);
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean canTarget(UUID id, Cards cards, Game game) {
    Card card = cards.get(id, game);
    if (card != null) {
      for (UUID targetId : this.getTargets()) {
        Card iCard = game.getCard(targetId);
        if (iCard != null && iCard.getName().equals(card.getName())) {
          return false;
        }
      }
      return filter.match(card, game);
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean canTarget(UUID id, Cards cards, Game game) {
    Card card = cards.get(id, game);
    if (card != null) {
      for (UUID targetId : this.getTargets()) {
        Card iCard = game.getCard(targetId);
        if (iCard != null && iCard.getName().equals(card.getName())) {
          return false;
        }
      }
      return filter.match(card, game);
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  paid = false;
  Player player = game.getPlayer(controllerId);
  if (player != null) {
    Card card = player.getHand().get(ability.getSourceId(), game);
    if (card != null) {
      Cards cards = new CardsImpl(card);
      paid = true;
      player.revealCards("Reveal card cost", cards, game);
    }
  }
  return paid;
}
origin: magefree/mage

@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  Player controller = game.getPlayer(controllerId);
  if (controller != null) {
    TargetCardInHand target = new TargetCardInHand();
    controller.chooseTarget(Outcome.ReturnToHand, target, ability, game);
    Card card = controller.getHand().get(target.getFirstTarget(), game);
    if (card != null) {
      controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, ability, false);
      paid = true;
    }
  }
  return paid;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      TargetCardInHand target = new TargetCardInHand();
      controller.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = controller.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        controller.putCardsOnTopOfLibrary(new CardsImpl(card), game, source, false);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    return false;
  }
}
origin: magefree/mage

  private boolean putOnLibrary(Player player, Ability source, Game game) {
    TargetCardInHand target = new TargetCardInHand();
    if (target.canChoose(source.getSourceId(), player.getId(), game)) {
      player.chooseTarget(Outcome.ReturnToHand, target, source, game);
      Card card = player.getHand().get(target.getFirstTarget(), game);
      if (card != null) {
        return player.moveCardToLibraryWithInfo(card, source.getSourceId(), game, Zone.HAND, true, false);
      }
    }
    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 pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  Player player = game.getPlayer(controllerId);
  if (player != null) {
    Card card = player.getHand().get(sourceId, game);
    if (card != null) {
      game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLE_CARD, card.getId(), card.getId(), card.getOwnerId()));
      paid = player.discard(card, null, game);
      if (paid) {
        game.fireEvent(GameEvent.getEvent(GameEvent.EventType.CYCLED_CARD, card.getId(), card.getId(), card.getOwnerId()));
      }
    }
  }
  return paid;
}
mage.cardsCardsget

Popular methods of Cards

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

Popular in Java

  • Making http requests using okhttp
  • findViewById (Activity)
  • startActivity (Activity)
  • getSystemService (Context)
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • IOUtils (org.apache.commons.io)
    General IO stream manipulation utilities. This class provides static utility methods for input/outpu
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now