gpt4 book ai didi

com.cardshifter.modapi.cards.ZoneChangeEvent类的使用及代码示例

转载 作者:知者 更新时间:2024-03-13 12:26:34 25 4
gpt4 key购买 nike

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

ZoneChangeEvent介绍

暂无

代码示例

代码示例来源:origin: Cardshifter/Cardshifter

private void removeCheck(ZoneChangeEvent event) {
    if (event.getDestination() instanceof BattlefieldComponent) {
      return;
    }
    if (event.getCard() == owningEntity) {
      event.getCard().getGame().removeSystem(systemToRemove);
    }
  }
}

代码示例来源:origin: Cardshifter/Cardshifter

/**
 * Gets the card entity for the card, then sends a ZoneChangeMessage to all clients.
 * Checks if the player has knowledge of the zone, and sends the real card data if so
 * 
 * @param event The ZoneChangeEvent object
 */
private void zoneChange(ZoneChangeEvent event) {
  Entity cardEntity = event.getCard();
  int source = -1;
  if (event.getSource() != null) {
    source = event.getSource().getZoneId();
  }
  for (ClientIO io : this.getPlayers()) {
    Entity player = playerFor(io);
    boolean sourceKnown = false;
    if (event.getSource() != null) {
      sourceKnown = event.getSource().isKnownTo(player);
    }
    io.sendToClient(new ZoneChangeMessage(event.getCard().getId(), source, event.getDestination().getZoneId()));
    if (event.getDestination().isKnownTo(player) && !sourceKnown) {
      sendRealCardData(io, event.getDestination().getZoneId(), cardEntity);
    }
  }
}

代码示例来源:origin: Cardshifter/Cardshifter

private void moveTo(ZoneComponent target, boolean top) {
  Entity card = getEntity();
  ZoneChangeEvent event = new ZoneChangeEvent(currentZone, target, card);
  
  executeEvent(event, () -> {
    if (event.getSource() != null) {
      event.getSource().cardMoveFrom(card);
    }
    ZoneComponent dest = event.getDestination();
    if (dest != null) {
      if (top) {
        dest.cardMoveAtTop(card);
      }
      else {
        dest.cardMoveAtBottom(card);
      }
    }
    this.currentZone = dest;
  });
}

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