simplify getCostEvent

master
melvin 2012-11-29 13:26:31 +08:00
parent 3c152a890e
commit 3521803877
1 changed files with 9 additions and 10 deletions

View File

@ -478,16 +478,15 @@ public class MagicCardDefinition {
} }
public MagicEvent[] getCostEvent(final MagicCard source) { public MagicEvent[] getCostEvent(final MagicCard source) {
final MagicManaCost cost = getCost(); List<MagicEvent> costEvent = new ArrayList<MagicEvent>();
return cost == MagicManaCost.ZERO ? if (cost != MagicManaCost.ZERO) {
MagicEvent.NO_EVENTS : costEvent.add(new MagicPayManaCostEvent(
new MagicEvent[]{ source,
new MagicPayManaCostEvent( source.getController(),
source, cost
source.getController(), ));
cost }
) return costEvent.toArray(new MagicEvent[0]);
};
} }
public boolean isPlayable(final MagicPlayerProfile profile) { public boolean isPlayable(final MagicPlayerProfile profile) {