setPriority to human player moved from Input and CField to Player.playSpellAbility (that both sources call)

InputProxy.selectCard no longer requires PlayerZone (it can be derived from card by those who needed it)
ComputerUtil - rem imports
This commit is contained in:
Maxmtg
2013-03-20 04:30:05 +00:00
parent 06bf9d3e65
commit a0de29bc13
7 changed files with 8 additions and 13 deletions

View File

@@ -85,7 +85,6 @@ public class InputPassPriority extends Input {
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(card, player));
if ( null != ab) {
player.playSpellAbility(card, ab);
Singletons.getModel().getGame().getPhaseHandler().setPriority(player);
}
else {
SDisplayUtil.remind(VMessage.SINGLETON_INSTANCE);

View File

@@ -36,11 +36,8 @@ import forge.card.ability.ApiType;
import forge.card.ability.effects.CharmEffect;
import forge.card.cardfactory.CardFactoryUtil;
import forge.card.cost.Cost;
import forge.card.cost.CostPart;
import forge.card.cost.CostPartMana;
import forge.card.cost.CostPayment;
import forge.card.cost.CostUtil;
import forge.card.mana.ManaCost;
import forge.card.spellability.AbilityStatic;
import forge.card.spellability.SpellAbility;
import forge.card.spellability.Target;

View File

@@ -2994,10 +2994,12 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
* @param ab
*/
public void playSpellAbility(Card c, SpellAbility ab) {
if (ab == Ability.PLAY_LAND_SURROGATE) {
if (ab == Ability.PLAY_LAND_SURROGATE)
this.playLand(c);
} else
else {
game.getActionPlay().playSpellAbility(ab, this);
}
game.getPhaseHandler().setPriority(this);
}
/**

View File

@@ -24,7 +24,6 @@ import forge.Card;
import forge.Singletons;
import forge.control.input.Input;
import forge.game.player.Player;
import forge.game.zone.PlayerZone;
import forge.view.ButtonUtil;
/**
@@ -102,7 +101,7 @@ public class InputProxy implements Observer {
* @param zone
* a {@link forge.game.zone.PlayerZone} object.
*/
public final void selectCard(final Card card, final PlayerZone zone) {
public final void selectCard(final Card card) {
this.getInput().selectCard(card);
}

View File

@@ -114,7 +114,7 @@ public class CCommand implements ICDoc {
if (c != null && c.isInZone(ZoneType.Command)) {
//TODO: Cast commander/activate avatar/roll planar dice here.
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c, player.getZone(ZoneType.Command));
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c);
}
}

View File

@@ -348,7 +348,6 @@ public class CField implements ICDoc {
SpellAbility ab = player.getController().getAbilityToPlay(game.getAbilitesOfCard(c, player));
if ( null != ab) {
player.playSpellAbility(c, ab);
game.getPhaseHandler().setPriority(player);
}
}
}.actionPerformed(null);

View File

@@ -108,8 +108,7 @@ public class CHand implements ICDoc {
public void mousePressed(final MouseEvent e) {
if (e.getButton() != MouseEvent.BUTTON1) { return; }
CMessage.SINGLETON_INSTANCE.getInputControl()
.selectCard(cardobj, Singletons.getControl().getPlayer().getZone(ZoneType.Hand));
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(cardobj);
}
});
}
@@ -184,7 +183,7 @@ public class CHand implements ICDoc {
}
final Card c = view.getHandArea().getHoveredCard(e);
if (c != null) {
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c, Singletons.getControl().getPlayer().getZone(ZoneType.Hand));
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c);
}
}