热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

mage.constants.Zone类的使用及代码示例

本文整理了Java中mage.constants.Zone类的一些代码示例,展示了Zone类的具体用法。这些代码示例主要来源于Gi

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

Zone介绍

暂无

代码示例

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

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

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

@Override
public boolean applies(UUID objectId, Ability affectedAbility, Ability source, Game game, UUID affectedControllerId) {
if (affectedAbility != null && affectedAbility.getSourceId().equals(source.getSourceId())
&& affectedControllerId.equals(source.getControllerId())) {
return game.getState().getZone(objectId).equals(Zone.GRAVEYARD);
}
return false;
}

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

@Override
public boolean apply(Ability input, Game game) {
return input.getZone().match(zone);
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
for (Zone z : Zone.values()) {
if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) {
return false;
}
}
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
if (filter.match(zEvent.getTarget(), sourceId, controllerId, game)) {
return true;
}
}
return false;
}

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

@Override
public boolean apply(Game game, Ability source) {
Player cOntroller= game.getPlayer(source.getControllerId());
MageObject sourceObject = source.getSourceObject(game);
if (controller != null && sourceObject != null) {
Set toExile = new HashSet<>();
for (UUID permanentId : targetPointer.getTargets(game, source)) {
Permanent target = game.getPermanent(permanentId);
if (target != null) {
toExile.add(target);
}
}
controller.moveCards(toExile, Zone.EXILED, source, game);
game.applyEffects();
Set toBattlefield = new HashSet<>();
for (Card card : toExile) {
Zone currentZOne= game.getState().getZone(card.getId());
if (Zone.BATTLEFIELD != currentZone && currentZone.isPublicZone()) {
toBattlefield.add(card);
}
}
controller.moveCards(toBattlefield, Zone.BATTLEFIELD, source, game);
return true;
}
return false;
}
}

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

@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
for (Zone z : Zone.values()) {
if (game.getShortLivingLKI(sourceId, z) && z != Zone.GRAVEYARD) {
return false;
}
}
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
if (zEvent.getTarget() != null &&
zEvent.getTarget().isOwnedBy(this.getControllerId()) &&
zEvent.getTarget().isCreature()&&
!zEvent.getTarget().getId().equals(this.getSourceId())) {
return true;
}
}
return false;
}

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

@Override
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getSourceId());
Player cOntroller= game.getPlayer(source.getControllerId());
if (card != null && controller != null) {
Zone zOne= game.getState().getZone(card.getId());
// cards needs to be in public non battlefield zone
if (zOne== Zone.BATTLEFIELD || !zone.isPublicZone()) {
return true;
}
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
controller.moveCards(card, Zone.BATTLEFIELD, source, game, false, false, false, null);
}
return true;
}
}

代码示例来源: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

@Override
public boolean apply(StackObject input, Game game) {
return input instanceof Spell && ((Spell) input).getFromZone().match(zone);
}

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

@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
Card card = game.getCard(objectId);
if (card != null) {
return (affectedControllerId.equals(source.getControllerId())
&& StaticFilters.FILTER_CARD_INSTANT_OR_SORCERY.match(card, game)
&& Zone.GRAVEYARD.equals(game.getState().getZone(card.getId())));
}
return false;
}
}

代码示例来源: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

@Override
public Abilities getPlayableAbilities(Zone zone) {
return stream()
.filter(ability -> (ability instanceof ActivatedAbility))
.filter(ability -> ability.getZone().match(zone))
.map(ability -> (ActivatedAbility) ability)
.collect(Collectors.toCollection(AbilitiesImpl::new));
}

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

boolean isCastFromPlayersLibrary(Game game, UUID playerId) {
if (!game.getStack().isEmpty()) {
StackObject stackObject = game.getStack().getLast();
return stackObject instanceof Spell
&& !((Spell) stackObject).isDoneActivatingManaAbilities()
&& Zone.LIBRARY.equals(((Spell) stackObject).getFromZone());
}
return false;
}

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

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

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

@Override
public Abilities getActivatedAbilities(Zone zone) {
return stream()
.filter(ability -> ability instanceof ActivatedAbility)
.filter(ability -> ability.getZone().match(zone))
.map(ability -> (ActivatedAbility) ability)
.collect(Collectors.toCollection(AbilitiesImpl::new));
}

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

@Override
public boolean apply(Game game, Ability source) {
Player cOntroller= game.getPlayer(source.getControllerId());
MageObject sourceObject = game.getObject(source.getSourceId());
if (controller != null && sourceObject != null) {
Set cards = new HashSet<>(controller.getLibrary().getTopCards(game, 3));
if (!cards.isEmpty()) {
controller.moveCardsToExile(cards, source, game, true, source.getSourceId(), sourceObject.getIdName());
// remove cards that could not be moved to exile
for (Card card : cards) {
if (!Zone.EXILED.equals(game.getState().getZone(card.getId()))) {
cards.remove(card);
}
}
if (!cards.isEmpty()) {
ContinuousEffect effect = new PlayFromNotOwnHandZoneTargetEffect(Zone.EXILED, Duration.EndOfTurn);
effect.setTargetPointer(new FixedTargets(cards, game));
game.addEffect(effect, source);
}
}
return true;
}
return false;
}

代码示例来源: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 Abilities getStaticAbilities(Zone zone) {
return stream()
.filter(ability -> ability instanceof StaticAbility)
.filter(ability -> ability.getZone().match(zone))
.map(ability -> (StaticAbility) ability)
.collect(Collectors.toCollection(AbilitiesImpl::new));
}

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

@Override
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
if (!(source instanceof FlashbackAbility)
&& affectedControllerId.equals(source.getControllerId())
&& game.isActivePlayer(source.getControllerId())) {
Card card = game.getCard(objectId);
if (card != null
&& (card.isInstant()
|| card.isSorcery())
&& game.getState().getZone(objectId).equals(Zone.GRAVEYARD)) {
// check if not already a card was cast this turn with this ability
KessDissidentMageWatcher watcher = game.getState().getWatcher(KessDissidentMageWatcher.class);
return watcher != null
&& !watcher.isAbilityUsed(new MageObjectReference(source.getSourceId(), game));
}
}
return false;
}
}

代码示例来源: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;
}

推荐阅读
  • 本文详细介绍如何在SSM(Spring + Spring MVC + MyBatis)框架中实现分页功能。包括分页的基本概念、数据准备、前端分页栏的设计与实现、后端分页逻辑的编写以及最终的测试步骤。 ... [详细]
  • 使用 ModelAttribute 实现页面数据自动填充
    本文介绍了如何利用 Spring MVC 中的 ModelAttribute 注解,在页面跳转后自动填充表单数据。主要探讨了两种实现方法及其背后的原理。 ... [详细]
  • 在AngularJS中,有时需要在表单内包含某些控件,但又不希望这些控件导致表单变为脏状态。例如,当用户对表单进行修改后,表单的$dirty属性将变为true,触发保存对话框。然而,对于一些导航或辅助功能控件,我们可能并不希望它们触发这种行为。 ... [详细]
  • 我在尝试将组合框转换为具有自动完成功能时遇到了一个问题,即页面上的列表框也被转换成了自动完成下拉框,而不是保持原有的多选列表框形式。 ... [详细]
  • iOS如何实现手势
    这篇文章主要为大家展示了“iOS如何实现手势”,内容简而易懂,条理清晰,希望能够帮助大家解决疑惑,下面让小编带领大家一起研究并学习一下“iOS ... [详细]
  • 本文旨在探讨Swift中的Closure与Objective-C中的Block之间的区别与联系,通过定义、使用方式以及外部变量捕获等方面的比较,帮助开发者更好地理解这两种机制的特点及应用场景。 ... [详细]
  • 本文探讨了如何使用Scrapy框架构建高效的数据采集系统,以及如何通过异步处理技术提升数据存储的效率。同时,文章还介绍了针对不同网站采用的不同采集策略。 ... [详细]
  • 本文介绍如何通过Java代码调用阿里云短信服务API来实现短信验证码的发送功能,包括必要的依赖添加和关键代码示例。 ... [详细]
  • 探讨多种方法来确定Java对象的实际类型,包括使用instanceof关键字、getClass()方法等。 ... [详细]
  • HDU 2537 键盘输入处理
    题目描述了一个名叫Pirates的男孩想要开发一款键盘输入软件,遇到了大小写字母判断的问题。本文提供了该问题的解决方案及实现方法。 ... [详细]
  • STM32代码编写STM32端不需要写关于连接MQTT服务器的代码,连接的工作交给ESP8266来做,STM32只需要通过串口接收和发送数据,间接的与服务器交互。串口三配置串口一已 ... [详细]
  • Hadoop MapReduce 实战案例:手机流量使用统计分析
    本文通过一个具体的Hadoop MapReduce案例,详细介绍了如何利用MapReduce框架来统计和分析手机用户的流量使用情况,包括上行和下行流量的计算以及总流量的汇总。 ... [详细]
  • 一、使用Microsoft.Office.Interop.Excel.DLL需要安装Office代码如下:2publicstaticboolExportExcel(S ... [详细]
  • egg实现登录鉴权(七):权限管理
    权限管理包含三部分:访问页面的权限,操作功能的权限和获取数据权限。页面权限:登录用户所属角色的可访问页面的权限功能权限:登录用户所属角色的可访问页面的操作权限数据权限:登录用户所属 ... [详细]
  • Java多线程售票案例分析
    本文通过一个售票系统的实例,深入探讨了Java中的多线程技术及其在资源共享和并发控制中的应用。售票过程涉及查询、收款、找零和出票等多个步骤,其中对总票数的管理尤为关键。 ... [详细]
author-avatar
王怡君3018
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有