- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中mage.game.events.ZoneChangeEvent.getTargetId()
方法的一些代码示例,展示了ZoneChangeEvent.getTargetId()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneChangeEvent.getTargetId()
方法的具体详情如下:
包路径:mage.game.events.ZoneChangeEvent
类名称:ZoneChangeEvent
方法名:getTargetId
暂无
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
return zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getTargetId().equals(this.cardId);
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.BATTLEFIELD) {
Card card = game.getCard(zEvent.getTargetId());
if (card != null && card.isLand()) {
return true;
}
}
return false;
}
}
代码示例来源:origin: magefree/mage
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()
&& zEvent.getTarget() != null
&& zEvent.getTarget().isCreature()) {
diedThisTurn.add(zEvent.getTargetId());
}
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
this.getTargets().clear(); // else spell fizzles because target creature died
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.BATTLEFIELD && (zEvent.getFromZone() == Zone.GRAVEYARD || zEvent.getFromZone() == Zone.LIBRARY)) {
Card card = game.getCard(zEvent.getTargetId());
if (card != null && card.isCreature()) {
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
Permanent permanent = zEvent.getTarget();
if (permanent != null
&& zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getFromZone() == Zone.BATTLEFIELD) {
return !onlyToControllerGraveyard || this.isControlledBy(game.getOwnerId(zEvent.getTargetId()));
}
}
return false;
}
代码示例来源:origin: magefree/mage
public static boolean cast(ZoneChangeInfo info, Game game) {
if (maybeRemoveFromSourceZone(info, game)) {
placeInDestinationZone(info, game);
// create a group zone change event if a card is moved to stack for casting (it's always only one card, but some effects check for group events (one or more xxx))
Set<Card> cards = new HashSet<>();
Card targetCard = getTargetCard(game, info.event.getTargetId());
cards.add(targetCard);
game.fireEvent(new ZoneChangeGroupEvent(cards, info.event.getSourceId(), info.event.getPlayerId(), info.event.getFromZone(), info.event.getToZone()));
// normal movement
game.fireEvent(info.event);
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent() && zEvent.getTarget() != null
&& zEvent.getTarget().isCreature()
&& !(zEvent.getTarget() instanceof PermanentToken)) {
int count = getAmountOfNontokenCreatureDiedThisTurn(zEvent.getTargetId());
amountOfCreaturesThatDied.put(zEvent.getTarget().getControllerId(), ++count);
}
}
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()) {
Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
if (permanent != null && game.getOpponents(controllerId).contains(permanent.getOwnerId())) {
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getOwnerId()));
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
if (permanent != null
&& permanent.isCreature()
&& permanent.getCounters(game).containsKey(CounterType.M1M1)) {
return true;
}
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.GRAVEYARD) {
Card card = game.getCard(zEvent.getTargetId());
Player controller = game.getPlayer(getControllerId());
return card != null
&& card.isCreature()
&& controller != null
&& controller.hasOpponent(card.getOwnerId(), game);
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.GRAVEYARD && zEvent.getFromZone() == Zone.BATTLEFIELD) {
Card card = game.getCard(zEvent.getTargetId());
Player controller = game.getPlayer(getControllerId());
return card != null && controller != null && controller.hasOpponent(card.getOwnerId(), game);
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent() && zEvent.getTarget() != null && zEvent.getTargetId().equals(getTargets().getFirstTarget())) {
this.getTargets().clear(); // else spell fizzles because target creature died
Target target = new TargetPlayer();
target.add(zEvent.getTarget().getControllerId(), game);
this.addTarget(target);
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getToZone() == Zone.GRAVEYARD
&& zEvent.getFromZone() == Zone.BATTLEFIELD
&& zEvent.getTarget().isArtifact()
&& zEvent.getTarget().isOwnedBy(this.controllerId)) {
this.getEffects().setTargetPointer(new FixedTarget(zEvent.getTargetId()));
return true;
}
return false;
}
代码示例来源:origin: magefree/mage
private static Card takeAttributesFromSpell(Card card, ZoneChangeEvent event, Game game) {
card = card.copy();
if (Zone.STACK == event.getFromZone()) {
Spell spell = game.getStack().getSpell(event.getTargetId());
if (spell != null && !spell.isFaceDown(game)) {
if (!card.getColor(game).equals(spell.getColor(game))) {
// the card that is referenced to in the permanent is copied and the spell attributes are set to this copied card
card.getColor(game).setColor(spell.getColor(game));
}
}
}
return card;
}
代码示例来源:origin: magefree/mage
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = game.getPermanentOrLKIBattlefield(zEvent.getTargetId());
if (permanent != null
&& permanent.isCreature()
&& permanent.getCounters(game).containsKey(CounterType.FUNGUS)) {
Effect effect = this.getEffects().get(0);
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
return true;
}
}
return false;
}
我正在制作一个简单的游戏,其中敌人在屏幕上四处移动,我们需要射击他们。我想模块化我的代码,所以我想用一个函数替换游戏循环逻辑。但是一旦我这样做,就会有一个下降以 fps 为单位。在while循环中调用
我使用的是标准匹配用户界面和两台 iPad iOS6。问题是当我在第一台设备中创建新的匹配项时,第二台设备应该在我查看匹配用户界面时看到现有的匹配项,但事实并非如此。我确定我的代码是正确的。这是方法:
在 The Practical Guide to Defect Prevention ,作者提到在软件开发中提高生产力的一种创造性方法是实现“生产力游戏”,员工以类似于在 Stack Overflow
我无法让游戏中心与我的应用一起工作。 每当我尝试对用户进行身份验证时,它都会返回以下错误: "The requested operation could not be completed becaus
我是 Game Maker 的新手。我已经创建了一个基于物理的小游戏的机制,并且我使用了 YoYo Games 教程中概述的方法来创建复杂的物理对象 (http://www.yoyogames.com
我正在编写一个 GML 脚本,想知道如何使消息出现在下一行: 例如。 show_message("Hello" + *something* + "World") 输出: Hello World 最佳答
关于这个已经有几个问题,但我按照他们的步骤解决了它,但它似乎对我不起作用。这是我所做的: 1.我仔细检查了 xcode 项目中的包标识符是否与供应门户上的供应配置文件完全相同(它还表示已启用 Game
GameKit 是否允许您以编程方式邀请特定的 Game Center friend 参加比赛,即不提供 GC ViewController?以下 handleInviteFromGameCenter
我正在 Game Maker: Studio 1.4 中构建客户端/服务器应用程序,需要运行游戏的两个实例进行测试。不幸的是,IDE 的运行/调试按钮在启动第一个副本后会自行禁用。有没有办法配置 ID
游戏已启动,我收到了用户的状态,一切就绪。我正在尝试构建一个问答游戏。我正在从远程服务器获取所有信息,其中包括基于问题的图像 Assets 。我可以获取远程数据,但无法显示图像。看来 facebook
我正在努力度过让 Game Center 集成发挥作用的第一阶段。我已经走到这一步了: 我创建了一个干净的新应用,在应用委托(delegate)中添加了 GameKit header 和基本的 aut
DragonRuby Game Toolkit 中好像没有按钮的概念。如何创建按钮等 UI 组件? 最佳答案 按钮(和任何其他 UI 组件)可以解构为 primitives: 按钮有一个点击空间(通常
我正在使用 DragonRuby Game Toolkit 构建游戏。 如何检测一个对象(例如 Sprite)是否与另一个 Sprite 发生碰撞? 这是放置在屏幕上的两个 Sprite 。关于如何检
我已经在我的应用中成功实现了 Game Center 排行榜,并使用 iOS 模拟器进行了测试。将新版本提交到 iTunes Connect 后,沙盒分数会转换到真正的 Game Center 吗?我
我读到 Unity 在渲染清晰文本时出现问题,我尝试了几种不同的修复方法:在导入的字体上设置较大的字体大小,并将字符设置更改为 unicode,使文本大小变大,然后缩放它向下,将过滤模式设置为指向像素
假设角色在游戏中跳跃需要一整秒,如果 FPS 为 10fps、30fps、100fps 等,游戏开发人员如何将跳跃时间保持在 1 秒? - 如果你明白我的意思,你会如何阻止游戏的 fps 基本上影响游
我一直在询问有关我的 Libgdx 游戏 Google Play 游戏服务配置错误的问题。到目前为止,我已经解决了登录错误,但现在我被困在解锁成就上。所以我发布我的代码可能有人可以帮助我。 这是我在
我正在将我的 Android 应用程序更新到最新的 Facebook SDK (4.0.0)。当我创建 GameRequestDialog 时,它向我显示此消息:“游戏请求仅适用于游戏”,而不是向我的
我创建了 GameOver.sks 和 GameOver.swift。如何在默认的 sprite-kit 项目中连接它们,例如 GameSense.sks 和 GameSense.swift? 最佳答
当前收到一个错误,指出无法找到我的 bean 中的 bankOffer 属性。 它来 self 的 game.jsp 文件,如下所示:
我是一名优秀的程序员,十分优秀!