mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user