- CheckStyle.

This commit is contained in:
Chris
2012-02-18 21:41:16 +00:00
parent efe6adc243
commit aeb44f00f0
3 changed files with 22 additions and 17 deletions

View File

@@ -12,14 +12,14 @@ import forge.util.IHasName;
public abstract class DeckBase implements IHasName, Serializable, Comparable<DeckBase> {
private static final long serialVersionUID = -7538150536939660052L;
// gameType is from Constant.GameType, like GameType.Regular
private final String name;
private String comment = null;
public DeckBase(String name0) {
name = name0;
}
@Override
public int compareTo(final DeckBase d) {
return this.getName().compareTo(d.getName());
@@ -33,15 +33,15 @@ public abstract class DeckBase implements IHasName, Serializable, Comparable<Dec
return this.getName().equals(d.getName());
}
return false;
}
}
@Override
public String getName() {
return this.name;
}
public abstract ItemPoolView<CardPrinted> getCardPool();
public void setComment(final String comment) {
this.comment = comment;
}
@@ -56,9 +56,9 @@ public abstract class DeckBase implements IHasName, Serializable, Comparable<Dec
public String getComment() {
return this.comment;
}
protected abstract DeckBase newInstance(String name0);
protected abstract DeckBase newInstance(String name0);
protected void cloneFieldsTo(DeckBase clone) {
clone.comment = this.comment;
}

View File

@@ -26,7 +26,7 @@ import forge.item.CardPrinted;
import forge.item.ItemPool;
/**
* Deck section
* Deck section.
*
*/
public class DeckSection extends ItemPool<CardPrinted> {
@@ -37,7 +37,7 @@ public class DeckSection extends ItemPool<CardPrinted> {
public DeckSection() {
super(CardPrinted.class);
}
public DeckSection(Iterable<Entry<CardPrinted, Integer>> cards) {
this();
addAll(cards);
@@ -80,8 +80,8 @@ public class DeckSection extends ItemPool<CardPrinted> {
*/
public void add(final String cardName, final String setCode, int amount) {
this.add(CardDb.instance().getCard(cardName, setCode), amount);
}
}
/**
* Adds the.
*

View File

@@ -21,7 +21,7 @@ public class DeckSet extends DeckBase implements IHasName {
private static final long serialVersionUID = -1628725522049635829L;
private Deck humanDeck;
private List<Deck> aiDecks = new ArrayList<Deck>();
public final Deck getHumanDeck() {
return humanDeck;
}
@@ -29,8 +29,12 @@ public class DeckSet extends DeckBase implements IHasName {
return aiDecks;
}
public final void setHumanDeck(Deck humanDeck) { this.humanDeck = humanDeck; }
public final void addAiDeck(Deck aiDeck) { if ( aiDeck != null ) this.aiDecks.add(aiDeck); }
public final void addAiDeck(Deck aiDeck) {
if (aiDeck != null) {
this.aiDecks.add(aiDeck);
}
}
@Override
public ItemPoolView<CardPrinted> getCardPool() {
@@ -38,8 +42,9 @@ public class DeckSet extends DeckBase implements IHasName {
}
public void addAiDecks(Deck[] computer) {
for(int i = 0; i < computer.length; i++)
for (int i = 0; i < computer.length; i++) {
aiDecks.add(computer[i]);
}
}
/* (non-Javadoc)
* @see forge.deck.DeckBase#newInstance(java.lang.String)
@@ -48,5 +53,5 @@ public class DeckSet extends DeckBase implements IHasName {
protected DeckBase newInstance(String name0) {
return new DeckSet(name0);
}
}