removed an unreferenced method and renamed another method

This commit is contained in:
Maxmtg
2013-04-11 20:25:57 +00:00
parent 38db2511db
commit 465a862070
6 changed files with 13 additions and 25 deletions

View File

@@ -1078,18 +1078,6 @@ public class Card extends GameEntity implements Comparable<Card> {
this.clones.add(c);
}
/**
* <p>
* addClones.
* </p>
*
* @param c
* a {@link java.util.ArrayList} object.
*/
public final void addClones(final ArrayList<Card> c) {
this.clones.addAll(c);
}
/**
* <p>
* clearClones.
@@ -1169,15 +1157,15 @@ public class Card extends GameEntity implements Comparable<Card> {
/**
* Can have counters placed on it.
*
* @param counterName
* @param type
* the counter name
* @return true, if successful
*/
public final boolean canHaveCountersPlacedOnIt(final CounterType counterName) {
public final boolean canReceiveCounters(final CounterType type) {
if (this.hasKeyword("CARDNAME can't have counters placed on it.")) {
return false;
}
if (this.isCreature() && counterName == CounterType.M1M1) {
if (this.isCreature() && type == CounterType.M1M1) {
for (final Card c : this.getController().getCreaturesInPlay()) { // look for Melira, Sylvok Outcast
if (c.hasKeyword("Creatures you control can't have -1/-1 counters placed on them.")) {
return false;
@@ -1188,7 +1176,7 @@ public class Card extends GameEntity implements Comparable<Card> {
}
public final int getTotalCountersToAdd(final CounterType counterType, final int baseAmount, final boolean applyMultiplier) {
if (!this.canHaveCountersPlacedOnIt(counterType)) {
if (!this.canReceiveCounters(counterType)) {
return 0;
}
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
@@ -1197,7 +1185,7 @@ public class Card extends GameEntity implements Comparable<Card> {
}
public final void addCounter(final CounterType counterType, final int n, final boolean applyMultiplier) {
if (!this.canHaveCountersPlacedOnIt(counterType)) {
if (!this.canReceiveCounters(counterType)) {
return;
}
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;

View File

@@ -49,7 +49,7 @@ public class CountersPutAi extends SpellAbilityAi {
list = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
@Override
public boolean apply(final Card c) {
return c.canBeTargetedBy(sa) && c.canHaveCountersPlacedOnIt(CounterType.valueOf(type));
return c.canBeTargetedBy(sa) && c.canReceiveCounters(CounterType.valueOf(type));
}
});

View File

@@ -97,7 +97,7 @@ public class CountersMoveEffect extends SpellAbilityEffect {
for (final Card dest : tgtCards) {
if ((null != source) && (null != dest)) {
if (!"Any".matches(counterName)) {
if (dest.canHaveCountersPlacedOnIt(cType)
if (dest.canReceiveCounters(cType)
&& source.getCounters(cType) >= amount) {
dest.addCounter(cType, amount, true);
source.subtractCounter(cType, amount);

View File

@@ -193,7 +193,7 @@ public class CostPutCounter extends CostPartWithList {
final Player activator = ability.getActivatingPlayer();
final Card source = ability.getSourceCard();
if (this.payCostFromSource()) {
if (!source.canHaveCountersPlacedOnIt(this.counter)) {
if (!source.canReceiveCounters(this.counter)) {
return false;
}
} else {

View File

@@ -457,7 +457,7 @@ public final class GameActionUtil {
CounterType counterType = ((CostPutCounter) part).getCounter();
int amount = getAmountFromPartX(part, source, sourceAbility);
if (false == source.canHaveCountersPlacedOnIt(counterType)) {
if (false == source.canReceiveCounters(counterType)) {
String message = String.format("Won't be able to pay upkeep for %s but it can't have %s counters put on it.", source, counterType.getName());
p.getGame().getGameLog().add("ResolveStack", message, 2);
return false;

View File

@@ -1384,9 +1384,9 @@ public class ComputerUtilCombat {
if (((attacker.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, attacker) && !withoutAbilities)) && !(defender
.hasKeyword("Wither") || defender.hasKeyword("Infect")))
|| (attacker.hasKeyword("Persist") && !attacker.canHaveCountersPlacedOnIt(CounterType.M1M1) && (attacker
|| (attacker.hasKeyword("Persist") && !attacker.canReceiveCounters(CounterType.M1M1) && (attacker
.getCounters(CounterType.M1M1) == 0))
|| (attacker.hasKeyword("Undying") && !attacker.canHaveCountersPlacedOnIt(CounterType.P1P1) && (attacker
|| (attacker.hasKeyword("Undying") && !attacker.canReceiveCounters(CounterType.P1P1) && (attacker
.getCounters(CounterType.P1P1) == 0))) {
return false;
}
@@ -1533,9 +1533,9 @@ public class ComputerUtilCombat {
if (((defender.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, defender) && !withoutAbilities)) && !(attacker
.hasKeyword("Wither") || attacker.hasKeyword("Infect")))
|| (defender.hasKeyword("Persist") && !defender.canHaveCountersPlacedOnIt(CounterType.M1M1) && (defender
|| (defender.hasKeyword("Persist") && !defender.canReceiveCounters(CounterType.M1M1) && (defender
.getCounters(CounterType.M1M1) == 0))
|| (defender.hasKeyword("Undying") && !defender.canHaveCountersPlacedOnIt(CounterType.P1P1) && (defender
|| (defender.hasKeyword("Undying") && !defender.canReceiveCounters(CounterType.P1P1) && (defender
.getCounters(CounterType.P1P1) == 0))) {
return false;
}