mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- CheckStyle.
This commit is contained in:
@@ -210,30 +210,30 @@ public abstract class Player extends GameEntity implements Comparable<Player> {
|
|||||||
public abstract boolean isComputer();
|
public abstract boolean isComputer();
|
||||||
public abstract PlayerType getType();
|
public abstract PlayerType getType();
|
||||||
|
|
||||||
public List<Card> getSchemeDeck()
|
public List<Card> getSchemeDeck() {
|
||||||
{
|
|
||||||
return schemeDeck;
|
return schemeDeck;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSchemeDeck(Iterable<Card> sd)
|
public void setSchemeDeck(Iterable<Card> sd) {
|
||||||
{
|
|
||||||
schemeDeck.clear();
|
schemeDeck.clear();
|
||||||
for(Card c : sd)
|
for (Card c : sd) {
|
||||||
{
|
|
||||||
schemeDeck.add(c);
|
schemeDeck.add(c);
|
||||||
c.setOwner(this);
|
c.setOwner(this);
|
||||||
}
|
}
|
||||||
CardLists.shuffle(schemeDeck);
|
CardLists.shuffle(schemeDeck);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isArchenemy()
|
public boolean isArchenemy() {
|
||||||
{
|
|
||||||
//Only the archenemy has schemes.
|
//Only the archenemy has schemes.
|
||||||
return schemeDeck.size() > 0;
|
return schemeDeck.size() > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setSchemeInMotion()
|
public void setSchemeInMotion() {
|
||||||
{
|
|
||||||
// Replacement effects
|
// Replacement effects
|
||||||
final HashMap<String, Object> repRunParams = new HashMap<String, Object>();
|
final HashMap<String, Object> repRunParams = new HashMap<String, Object>();
|
||||||
repRunParams.put("Event", "SetInMotion");
|
repRunParams.put("Event", "SetInMotion");
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ public class GuiChoose {
|
|||||||
|
|
||||||
if (sideboardingMode) {
|
if (sideboardingMode) {
|
||||||
persistentDeck.getMain().clear();
|
persistentDeck.getMain().clear();
|
||||||
persistentDeck.getMain().add((List<Card>)dual.getOrderedList());
|
persistentDeck.getMain().add((List<Card>) dual.getOrderedList());
|
||||||
persistentDeck.getSideboard().clear();
|
persistentDeck.getSideboard().clear();
|
||||||
persistentDeck.getSideboard().add((List<Card>)dual.getRemainingSourceList());
|
persistentDeck.getSideboard().add((List<Card>) dual.getRemainingSourceList());
|
||||||
}
|
}
|
||||||
|
|
||||||
dialog.dispose();
|
dialog.dispose();
|
||||||
|
|||||||
@@ -129,8 +129,8 @@ public class SEditorIO {
|
|||||||
// Confirm if overwrite
|
// Confirm if overwrite
|
||||||
else if (controller.fileExists(name)) {
|
else if (controller.fileExists(name)) {
|
||||||
final int m = JOptionPane.showConfirmDialog(null,
|
final int m = JOptionPane.showConfirmDialog(null,
|
||||||
limitedDeckMode ? "Would you like to save changes to your deck?" :
|
limitedDeckMode ? "Would you like to save changes to your deck?"
|
||||||
"There is already a deck named '" + name + "'. Overwrite?",
|
: "There is already a deck named '" + name + "'. Overwrite?",
|
||||||
limitedDeckMode ? "Save changes?" : "Overwrite Deck?",
|
limitedDeckMode ? "Save changes?" : "Overwrite Deck?",
|
||||||
JOptionPane.YES_NO_OPTION,
|
JOptionPane.YES_NO_OPTION,
|
||||||
JOptionPane.QUESTION_MESSAGE);
|
JOptionPane.QUESTION_MESSAGE);
|
||||||
|
|||||||
@@ -121,7 +121,7 @@ public final class CEditorScheme extends ACEditorBase<CardPrinted, Deck> {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void resetTables() {
|
public void resetTables() {
|
||||||
this.getTableCatalog().setDeck(ItemPool.createFrom(Iterables.filter(CardDb.instance().getAllNonTraditionalCards(),CardPrinted.Predicates.type("Scheme")), CardPrinted.class));
|
this.getTableCatalog().setDeck(ItemPool.createFrom(Iterables.filter(CardDb.instance().getAllNonTraditionalCards(), CardPrinted.Predicates.type("Scheme")), CardPrinted.class));
|
||||||
this.getTableDeck().setDeck(this.controller.getModel().getSchemes());
|
this.getTableDeck().setDeck(this.controller.getModel().getSchemes());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ public final class EditorTableView<T extends InventoryItem> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* setWantUnique
|
* setWantUnique.
|
||||||
*
|
*
|
||||||
* @param unique if true, the editor will be set to the "unique card names only" mode.
|
* @param unique if true, the editor will be set to the "unique card names only" mode.
|
||||||
*/
|
*/
|
||||||
@@ -336,7 +336,7 @@ public final class EditorTableView<T extends InventoryItem> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* getAlwaysNonUnique
|
* getAlwaysNonUnique.
|
||||||
*
|
*
|
||||||
* @return if ture, this editor must always show non-unique cards (e.g. quest editor).
|
* @return if ture, this editor must always show non-unique cards (e.g. quest editor).
|
||||||
*/
|
*/
|
||||||
@@ -346,7 +346,7 @@ public final class EditorTableView<T extends InventoryItem> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* setAlwaysNonUnique
|
* setAlwaysNonUnique.
|
||||||
*
|
*
|
||||||
* @param nonUniqueOnly if true, this editor must always show non-unique cards (e.g. quest editor).
|
* @param nonUniqueOnly if true, this editor must always show non-unique cards (e.g. quest editor).
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ public class ManaCostRenderer extends DefaultTableCellRenderer {
|
|||||||
|
|
||||||
// Display X Mana before any other type of mana
|
// Display X Mana before any other type of mana
|
||||||
if (xManaCosts > 0) {
|
if (xManaCosts > 0) {
|
||||||
for(int i = 0; i < xManaCosts; i++) {
|
for (int i = 0; i < xManaCosts; i++) {
|
||||||
CardFaceSymbols.drawSymbol(ManaCostShard.X.getImageKey(), g, (int) xpos, 1);
|
CardFaceSymbols.drawSymbol(ManaCostShard.X.getImageKey(), g, (int) xpos, 1);
|
||||||
xpos += offset;
|
xpos += offset;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,18 +159,17 @@ public enum CSubmenuArchenemy implements ICDoc {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (obj instanceof String) {
|
if (obj instanceof String) {
|
||||||
String sel = (String)obj;
|
String sel = (String) obj;
|
||||||
if(sel.equals("Random"))
|
if (sel.equals("Random")) {
|
||||||
{
|
|
||||||
schemes = Iterables.get(view.getAllSchemeDecks(), rnd.nextInt(Iterables.size(view.getAllSchemeDecks()))).getSchemes().toFlatList();
|
schemes = Iterables.get(view.getAllSchemeDecks(), rnd.nextInt(Iterables.size(view.getAllSchemeDecks()))).getSchemes().toFlatList();
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
//Generate
|
//Generate
|
||||||
schemes = DeckgenUtil.generateSchemeDeck().getSchemes().toFlatList();
|
schemes = DeckgenUtil.generateSchemeDeck().getSchemes().toFlatList();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
schemes = ((Deck)obj).getSchemes().toFlatList();
|
schemes = ((Deck) obj).getSchemes().toFlatList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (schemes == null) {
|
if (schemes == null) {
|
||||||
@@ -189,13 +188,12 @@ public enum CSubmenuArchenemy implements ICDoc {
|
|||||||
for (int i = 0; i < view.getNumPlayers(); i++) {
|
for (int i = 0; i < view.getNumPlayers(); i++) {
|
||||||
LobbyPlayer player = lobby.findLocalPlayer(i == 0 ? PlayerType.HUMAN : PlayerType.COMPUTER);
|
LobbyPlayer player = lobby.findLocalPlayer(i == 0 ? PlayerType.HUMAN : PlayerType.COMPUTER);
|
||||||
|
|
||||||
if(i == 0)
|
if (i == 0) {
|
||||||
{
|
|
||||||
helper.addArchenemy(player, playerDecks.get(i), schemes);
|
helper.addArchenemy(player, playerDecks.get(i), schemes);
|
||||||
helper.getPlayerMap().get(player).setStartingLife(10 + (10*(view.getNumPlayers()-1)));
|
helper.getPlayerMap().get(player).setStartingLife(10 + (10 * (view.getNumPlayers() - 1)));
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
helper.addPlayer(player, playerDecks.get(i));
|
helper.addPlayer(player, playerDecks.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,14 +133,14 @@ public enum VSubmenuArchenemy implements IVSubmenu<CSubmenuArchenemy> {
|
|||||||
deckChoosers.add(tempChooser);
|
deckChoosers.add(tempChooser);
|
||||||
|
|
||||||
tempPanel.add(tempChooser, "span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy, wrap");
|
tempPanel.add(tempChooser, "span 1 2, w 44%!, gap 0 0 20px 20px, growy, pushy, wrap");
|
||||||
if(i == 0)
|
if (i == 0) {
|
||||||
{
|
|
||||||
tempPanel.add(new FLabel.Builder().text("Select Scheme deck:").build(), "flowy");
|
tempPanel.add(new FLabel.Builder().text("Select Scheme deck:").build(), "flowy");
|
||||||
|
|
||||||
Vector<Object> listData = new Vector<Object>();
|
Vector<Object> listData = new Vector<Object>();
|
||||||
listData.add("Random");
|
listData.add("Random");
|
||||||
listData.add("Generate");
|
listData.add("Generate");
|
||||||
for(Deck schemeDeck : Singletons.getModel().getDecks().getScheme()) {
|
for (Deck schemeDeck : Singletons.getModel().getDecks().getScheme()) {
|
||||||
listData.add(schemeDeck);
|
listData.add(schemeDeck);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ public enum VLog implements IVDoc<CLog> {
|
|||||||
|
|
||||||
pnl.removeAll();
|
pnl.removeAll();
|
||||||
|
|
||||||
for (int i = size-1; i >= 0; i--) {
|
for (int i = size - 1; i >= 0; i--) {
|
||||||
JTextArea tar = new JTextArea(data.get(i).getMessage());
|
JTextArea tar = new JTextArea(data.get(i).getMessage());
|
||||||
|
|
||||||
if (i % 2 == 1) { tar.setOpaque(false); }
|
if (i % 2 == 1) { tar.setOpaque(false); }
|
||||||
|
|||||||
@@ -112,8 +112,9 @@ public class EventVisualizer {
|
|||||||
if (sa.isSpell()) {
|
if (sa.isSpell()) {
|
||||||
// if there's a specific effect for this particular card, play it and
|
// if there's a specific effect for this particular card, play it and
|
||||||
// we're done.
|
// we're done.
|
||||||
if (getSpecificCardEffect(source))
|
if (getSpecificCardEffect(source)) {
|
||||||
return SoundEffectType.ScriptedEffect;
|
return SoundEffectType.ScriptedEffect;
|
||||||
|
}
|
||||||
|
|
||||||
if (source.isCreature() && source.isArtifact()) {
|
if (source.isCreature() && source.isArtifact()) {
|
||||||
return SoundEffectType.ArtifactCreature;
|
return SoundEffectType.ArtifactCreature;
|
||||||
@@ -159,8 +160,9 @@ public class EventVisualizer {
|
|||||||
|
|
||||||
// if there's a specific effect for this particular card, play it and
|
// if there's a specific effect for this particular card, play it and
|
||||||
// we're done.
|
// we're done.
|
||||||
if (getSpecificCardEffect(land))
|
if (getSpecificCardEffect(land)) {
|
||||||
return SoundEffectType.ScriptedEffect;
|
return SoundEffectType.ScriptedEffect;
|
||||||
|
}
|
||||||
|
|
||||||
final List<SpellAbility> manaProduced = land.getManaAbility();
|
final List<SpellAbility> manaProduced = land.getManaAbility();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user