mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -338,8 +338,8 @@ public final class GuiDisplayUtil {
|
||||
* </p>
|
||||
*/
|
||||
public static void updateGUI() {
|
||||
for( Player p : Singletons.getModel().getGame().getRegisteredPlayers())
|
||||
{
|
||||
for (Player p : Singletons.getModel().getGame().getRegisteredPlayers()) {
|
||||
|
||||
// why was it written twice?
|
||||
p.getZone(ZoneType.Battlefield).updateObservers();
|
||||
}
|
||||
@@ -751,14 +751,18 @@ public final class GuiDisplayUtil {
|
||||
public static void devModeCardToHand() {
|
||||
final List<Player> players = Singletons.getModel().getGame().getPlayers();
|
||||
final Player p = GuiChoose.oneOrNone("Put card in play for which player?", players);
|
||||
if (null == p) return;
|
||||
if (null == p) {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<CardPrinted> cards = Lists.newArrayList(CardDb.instance().getAllUniqueCards());
|
||||
Collections.sort(cards);
|
||||
|
||||
// use standard forge's list selection dialog
|
||||
final CardPrinted c = GuiChoose.oneOrNone("Name the card", cards);
|
||||
if (c == null) return;
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Card forgeCard = c.toForgeCard(p);
|
||||
Singletons.getModel().getGame().getAction().moveToHand(forgeCard);
|
||||
@@ -768,22 +772,30 @@ public final class GuiDisplayUtil {
|
||||
public static void devModeCardToBattlefield() {
|
||||
final List<Player> players = Singletons.getModel().getGame().getPlayers();
|
||||
final Player p = GuiChoose.oneOrNone("Put card in play for which player?", players);
|
||||
if (null == p) return;
|
||||
if (null == p) {
|
||||
return;
|
||||
}
|
||||
|
||||
final List<CardPrinted> cards = Lists.newArrayList(CardDb.instance().getAllUniqueCards());
|
||||
Collections.sort(cards);
|
||||
|
||||
// use standard forge's list selection dialog
|
||||
final CardPrinted c = GuiChoose.oneOrNone("Name the card", cards);
|
||||
if (c == null) return;
|
||||
if (c == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
Card forgeCard = c.toForgeCard(p);
|
||||
|
||||
final List<SpellAbility> choices = forgeCard.getBasicSpells();
|
||||
if (choices.isEmpty()) return; // when would it happen?
|
||||
if (choices.isEmpty()) {
|
||||
return; // when would it happen?
|
||||
}
|
||||
|
||||
final SpellAbility sa = choices.size() == 1 ? choices.get(0) : GuiChoose.oneOrNone("Choose", choices);
|
||||
if (sa == null) return; // happens if cancelled
|
||||
if (sa == null) {
|
||||
return; // happens if cancelled
|
||||
}
|
||||
|
||||
sa.setActivatingPlayer(p);
|
||||
|
||||
|
||||
@@ -491,8 +491,8 @@ public final class GuiMigrateLocalMWSSetPicturesHQ extends DefaultBoundedRangeMo
|
||||
final String urlBase = "C:\\MTGForge\\HQPICS\\";
|
||||
String imgFN = "";
|
||||
|
||||
for (final CardPrinted cp : CardDb.instance().getAllTraditionalCards())
|
||||
{
|
||||
for (final CardPrinted cp : CardDb.instance().getAllTraditionalCards()) {
|
||||
|
||||
// String url = c.getSVar("Picture");
|
||||
// String[] URLs = url.split("\\\\");
|
||||
String edCode = cp.getEdition();
|
||||
|
||||
@@ -33,8 +33,9 @@ public class UnsortedListModel<T> extends AbstractListModel { // Java 7 has a ge
|
||||
}
|
||||
|
||||
public void addAll(T[] elements) {
|
||||
for(T e : elements)
|
||||
for (T e : elements) {
|
||||
model.add(e);
|
||||
}
|
||||
fireContentsChanged(this, 0, getSize());
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public enum CDeckEditorUI implements CardContainer {
|
||||
}
|
||||
|
||||
/**
|
||||
* Set Pack, for when Packs can be shown in the CardPicturePanel
|
||||
* Set Pack, for when Packs can be shown in the CardPicturePanel.
|
||||
* @param item
|
||||
*/
|
||||
public void setCard(final InventoryItem item) {
|
||||
|
||||
@@ -200,8 +200,9 @@ public class SFilterUtil {
|
||||
|
||||
Predicate<CardRules> preFinal = colors.isEmpty() && wantMulticolor ? CardRulesPredicates.Presets.IS_MULTICOLOR : optimizedAnd(preExceptMulti, preColors);
|
||||
|
||||
if ( null == preFinal)
|
||||
if (null == preFinal) {
|
||||
return Predicates.alwaysTrue();
|
||||
}
|
||||
|
||||
return Predicates.compose(preFinal, CardPrinted.FN_GET_RULES);
|
||||
}
|
||||
@@ -246,8 +247,9 @@ public class SFilterUtil {
|
||||
if (MAP_TYPE_CHECKBOXES.get(FilterProperty.PLANESWALKER).getCheckBox().isSelected()) { ors.add(CardRulesPredicates.Presets.IS_PLANESWALKER); }
|
||||
if (MAP_TYPE_CHECKBOXES.get(FilterProperty.SORCERY).getCheckBox().isSelected()) { ors.add(CardRulesPredicates.Presets.IS_SORCERY); }
|
||||
|
||||
if (ors.size() == 7)
|
||||
if (ors.size() == 7) {
|
||||
return Predicates.alwaysTrue();
|
||||
}
|
||||
|
||||
return Predicates.compose(Predicates.or(ors), CardPrinted.FN_GET_RULES);
|
||||
}
|
||||
@@ -312,7 +314,9 @@ public class SFilterUtil {
|
||||
filterNot = Predicates.not(Predicates.or(nots));
|
||||
}
|
||||
Predicate<CardRules> preResult = optimizedAnd(filterAnd, filterNot);
|
||||
if ( preResult == null ) return Predicates.alwaysTrue();
|
||||
if (preResult == null) {
|
||||
return Predicates.alwaysTrue();
|
||||
}
|
||||
return Predicates.compose(preResult, CardPrinted.FN_GET_RULES);
|
||||
}
|
||||
|
||||
@@ -349,11 +353,12 @@ public class SFilterUtil {
|
||||
preCreature = preCreature == null ? null : Predicates.and(preCreature, CardRulesPredicates.Presets.IS_CREATURE);
|
||||
|
||||
Predicate<CardRules> preFinal = optimizedAnd(preCMC, preCreature);
|
||||
if (preFinal == null)
|
||||
if (preFinal == null) {
|
||||
return Predicates.alwaysTrue();
|
||||
else
|
||||
} else {
|
||||
return Predicates.compose(preFinal, CardPrinted.FN_GET_RULES);
|
||||
}
|
||||
}
|
||||
|
||||
//========== Custom class handling
|
||||
|
||||
|
||||
Reference in New Issue
Block a user