gpt4 book ai didi

mage.constants.Zone.toString()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 07:09:31 27 4
gpt4 key购买 nike

本文整理了Java中mage.constants.Zone.toString()方法的一些代码示例,展示了Zone.toString()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Zone.toString()方法的具体详情如下:
包路径:mage.constants.Zone
类名称:Zone
方法名:toString

Zone.toString介绍

暂无

代码示例

代码示例来源:origin: magefree/mage

@Override
  public String toString() {
    return "Zone(" + zone.toString() + ')';
  }
}

代码示例来源:origin: magefree/mage

private void setText() {
    staticText = "target player exiles " + CardUtil.numberToText(amount, "a") + ' ' + filter.getMessage() + " from their " + zone.toString().toLowerCase(Locale.ENGLISH);
  }
}

代码示例来源:origin: magefree/mage

sb.append(targetPickedCards.toString().toLowerCase(Locale.ENGLISH));

代码示例来源:origin: magefree/mage

.append(" puts ").append(withName ? card.getLogName() : "a card").append(' ');
if (fromZone != null) {
  sb.append("from ").append(fromZone.toString().toLowerCase(Locale.ENGLISH)).append(' ');

代码示例来源:origin: magefree/mage

public void initComponents() {
  hand = new mage.client.cards.Cards(true);
  hand.setMinOffsetY(HAND_MIN_CARDS_OFFSET_Y);
  hand.setCardDimension(GUISizeHelper.handCardDimension);
  jPanel = new JPanel();
  jScrollPane1 = new JScrollPane(jPanel);
  jScrollPane1.getViewport().setBackground(new Color(0, 0, 0, 0));
  jPanel.setLayout(new GridBagLayout()); // centers hand
  jPanel.setBackground(new Color(0, 0, 0, 0));
  jPanel.add(hand);
  setOpaque(false);
  jPanel.setOpaque(false);
  jScrollPane1.setOpaque(false);
  jPanel.setBorder(EMPTY_BORDER);
  jScrollPane1.setBorder(EMPTY_BORDER);
  jScrollPane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_NEVER);
  jScrollPane1.getHorizontalScrollBar().setUnitIncrement(8);
  jScrollPane1.setViewportBorder(EMPTY_BORDER);
  setLayout(new BorderLayout());
  add(jScrollPane1, BorderLayout.CENTER);
  hand.setHScrollSpeed(8);
  hand.setBackgroundColor(new Color(0, 0, 0, 0));
  hand.setVisibleIfEmpty(false);
  hand.setBorder(EMPTY_BORDER);
  hand.setZone(Zone.HAND.toString());
}

代码示例来源:origin: magefree/mage

@Override
public boolean moveCardToGraveyardWithInfo(Card card, UUID sourceId,
    Game game, Zone fromZone
) {
  if (card == null) {
    return false;
  }
  boolean result = false;
  //    Zone fromZone = game.getState().getZone(card.getId());
  if (card.moveToZone(Zone.GRAVEYARD, sourceId, game, fromZone != null && fromZone == Zone.BATTLEFIELD)) {
    if (!game.isSimulation()) {
      if (card instanceof PermanentCard && game.getCard(card.getId()) != null) {
        card = game.getCard(card.getId());
      }
      StringBuilder sb = new StringBuilder(this.getLogName())
          .append(" puts ").append(card.getLogName()).append(' ').append(card.isCopy() ? "(Copy) " : "")
          .append(fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' : "");
      if (card.isOwnedBy(getId())) {
        sb.append("into their graveyard");
      } else {
        sb.append("it into its owner's graveyard");
      }
      game.informPlayers(sb.toString());
    }
    result = true;
  }
  return result;
}

代码示例来源:origin: magefree/mage

@Override
public boolean moveCardToExileWithInfo(Card card, UUID exileId, String exileName, UUID sourceId,
    Game game, Zone fromZone, boolean withName) {
  if (card == null) {
    return false;
  }
  boolean result = false;
  if (card.moveToExile(exileId, exileName, sourceId, game)) {
    if (!game.isSimulation()) {
      if (card instanceof PermanentCard) {
        // in case it's face down or name was changed by copying from other permanent
        Card basicCard = game.getCard(card.getId());
        if (basicCard != null) {
          card = basicCard;
        }
      } else if (card instanceof Spell) {
        final Spell spell = (Spell) card;
        if (spell.isCopy()) {
          // Copied spell, only remove from stack
          game.getStack().remove(spell, game);
        }
      }
      game.informPlayers(this.getLogName() + " moves " + (withName ? card.getLogName() + (card.isCopy() ? " (Copy)" : "") : "a card face down") + ' '
          + (fromZone != null ? "from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' ' : "") + "to the exile zone");
    }
    result = true;
  }
  return result;
}

代码示例来源:origin: magefree/mage

game.informPlayers(eventPlayer.getLogName() + " puts "
            + (info.faceDown ? "a card face down " : permanent.getLogName()) + " from "
            + fromZone.toString().toLowerCase(Locale.ENGLISH) + " onto the Battlefield");
throw new UnsupportedOperationException("to Zone" + toZone.toString() + " not supported yet");

代码示例来源:origin: magefree/mage

@Override
public boolean moveCardToHandWithInfo(Card card, UUID sourceId,
    Game game, boolean withName
) {
  boolean result = false;
  Zone fromZone = game.getState().getZone(card.getId());
  if (fromZone == Zone.BATTLEFIELD && !(card instanceof Permanent)) {
    card = game.getPermanent(card.getId());
  }
  if (card.moveToZone(Zone.HAND, sourceId, game, false)) {
    if (card instanceof PermanentCard && game.getCard(card.getId()) != null) {
      card = game.getCard(card.getId());
    }
    if (!game.isSimulation()) {
      game.informPlayers(getLogName() + " puts "
          + (withName ? card.getLogName() : (card.isFaceDown(game) ? "a face down card" : "a card"))
          + " from " + fromZone.toString().toLowerCase(Locale.ENGLISH) + ' '
          + (card.isOwnedBy(this.getId()) ? "into their hand" : "into its owner's hand")
      );
    }
    result = true;
  }
  return result;
}

代码示例来源:origin: magefree/mage

/**
 * Swap cards between specified card from library and any hand card.
 *
 * @param game
 * @param card Card to put to player's hand
 */
private static void swapWithAnyCard(Game game, Player player, Card card, Zone zone) {
  // Put the card in Exile to start. Otherwise the game doesn't know where to remove the card from.
  game.getExile().getPermanentExile().add(card);
  game.setZone(card.getId(), Zone.EXILED);
  switch (zone) {
    case BATTLEFIELD:
      card.putOntoBattlefield(game, Zone.EXILED, null, player.getId());
      break;
    case LIBRARY:
      card.setZone(Zone.LIBRARY, game);
      game.getExile().getPermanentExile().remove(card);
      player.getLibrary().putOnTop(card, game);
      break;
    case STACK:
      card.cast(game, Zone.EXILED, card.getSpellAbility(), player.getId());
    default:
      card.moveToZone(zone, null, game, false);
  }
  logger.info("Added card to player's " + zone.toString() + ": " + card.getName() + ", player = " + player.getName());
}

代码示例来源:origin: magefree/mage

break;
default:
  throw new UnsupportedOperationException("to Zone" + toZone.toString() + " not supported yet");

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com