removed some empty lines

master
melvin 2011-06-17 14:54:52 +08:00
parent 673a18cd10
commit 6dbd2a8211
1 changed files with 3 additions and 31 deletions

View File

@ -18,26 +18,21 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
private int imageIndex=0;
public MagicCard(final MagicCardDefinition cardDefinition,final MagicPlayer owner,final int id) {
this.cardDefinition=cardDefinition;
this.owner=owner;
this.id=id;
imageIndex=MagicRandom.nextInt(100);
}
private MagicCard() {
}
private MagicCard() {}
@Override
public MagicCopyable create() {
return new MagicCard();
}
@Override
public void copy(final MagicCopyMap copyMap,final MagicCopyable source) {
final MagicCard sourceCard=(MagicCard)source;
cardDefinition=sourceCard.cardDefinition;
owner=copyMap.copy(sourceCard.owner);
@ -48,7 +43,6 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
@Override
public Object map(final MagicGame game) {
final MagicPlayer mappedOwner=(MagicPlayer)owner.map(game);
final MagicCard card=mappedOwner.getHand().getCard(id);
if (card!=null) {
@ -58,17 +52,14 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
}
public long getId() {
return id;
}
public int getImageIndex() {
return imageIndex;
}
public MagicCardDefinition getCardDefinition() {
if (known) {
return cardDefinition;
} else {
@ -77,58 +68,48 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
}
public MagicPlayer getOwner() {
return owner;
}
public void setToken() {
token = true;
}
public boolean isToken() {
return token;
}
public static MagicCard createTokenCard(final MagicCardDefinition cardDefinition,final MagicPlayer owner) {
final MagicCard card=new MagicCard(cardDefinition,owner,MagicCard.TOKEN_ID);
card.setToken();
return card;
}
public void setKnown(final boolean known) {
this.known=known;
}
public boolean isKnown() {
return known;
}
@Override
public String getName() {
return getCardDefinition().getName();
}
@Override
public String toString() {
return getName();
}
@Override
public MagicPlayer getController() {
return owner;
}
@Override
public int getPreventDamage() {
return 0;
}
@ -139,55 +120,46 @@ public class MagicCard implements MagicSource,MagicTarget,Comparable<MagicCard>
@Override
public boolean isValidTarget(final MagicGame game,final MagicSource source) {
return true;
}
@Override
public boolean isPermanent() {
return false;
}
@Override
public boolean isPlayer() {
return false;
}
@Override
public boolean isSpell() {
return true;
}
@Override
public MagicColoredType getColoredType() {
return getCardDefinition().getColoredType();
}
@Override
public int getColorFlags() {
return getCardDefinition().getColorFlags();
}
@Override
public boolean hasAbility(final MagicGame game,final MagicAbility ability) {
return getCardDefinition().hasAbility(ability);
}
@Override
public Collection<MagicActivation> getActivations() {
return Collections.singletonList(cardDefinition.getCardActivation());
}
@Override
public int compareTo(final MagicCard card) {
return id-card.id;
}
}