mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Fix or suppress warnings
This commit is contained in:
@@ -5,6 +5,7 @@ import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.google.common.collect.Ordering;
|
||||
import com.google.common.collect.Sets;
|
||||
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
|
||||
import java.io.Serializable;
|
||||
@@ -221,6 +222,7 @@ public class FCollection<T> implements List<T>, Set<T>, FCollectionView<T>, Clon
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings("hiding")
|
||||
public <T> T[] toArray(final T[] a) {
|
||||
return list.toArray(a);
|
||||
}
|
||||
@@ -611,7 +613,9 @@ public class FCollection<T> implements List<T>, Set<T>, FCollectionView<T>, Clon
|
||||
return this;
|
||||
}
|
||||
@Override public final Object[] toArray() { return ArrayUtils.EMPTY_OBJECT_ARRAY; }
|
||||
@Override public final <T> T[] toArray(final T[] a) {
|
||||
@Override
|
||||
@SuppressWarnings("hiding")
|
||||
public final <T> T[] toArray(final T[] a) {
|
||||
if (a.length > 0) {
|
||||
a[0] = null;
|
||||
}
|
||||
|
||||
@@ -1070,7 +1070,7 @@ public class CardView extends GameEntityView {
|
||||
}
|
||||
boolean needFlagAsChanged = false;
|
||||
for (Card c : cardsToAdd) {
|
||||
if (c !=null && oldCards.add(c)) {
|
||||
if (c != null && oldCards.add(c)) {
|
||||
if (views == null) {
|
||||
views = new TrackableCollection<CardView>();
|
||||
views.add(c.getView());
|
||||
|
||||
@@ -60,9 +60,9 @@ import forge.toolbox.FSkin;
|
||||
@SuppressWarnings("serial")
|
||||
public final class DeckManager extends ItemManager<DeckProxy> implements IHasGameType {
|
||||
private static final FSkin.SkinIcon icoDelete = FSkin.getIcon(FSkinProp.ICO_DELETE);
|
||||
private static final FSkin.SkinIcon icoDeleteOver = FSkin.getIcon(FSkinProp.ICO_DELETE_OVER);
|
||||
//private static final FSkin.SkinIcon icoDeleteOver = FSkin.getIcon(FSkinProp.ICO_DELETE_OVER);
|
||||
private static final FSkin.SkinIcon icoEdit = FSkin.getIcon(FSkinProp.ICO_EDIT);
|
||||
private static final FSkin.SkinIcon icoEditOver = FSkin.getIcon(FSkinProp.ICO_EDIT_OVER);
|
||||
//private static final FSkin.SkinIcon icoEditOver = FSkin.getIcon(FSkinProp.ICO_EDIT_OVER);
|
||||
|
||||
private final GameType gameType;
|
||||
private UiCommand cmdDelete, cmdSelect;
|
||||
@@ -301,7 +301,7 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
}
|
||||
|
||||
public class DeckActionsRenderer extends ItemCellRenderer {
|
||||
private final int overActionIndex = -1;
|
||||
//private final int overActionIndex = -1;
|
||||
private static final int imgSize = 20;
|
||||
|
||||
@Override
|
||||
@@ -373,8 +373,8 @@ public final class DeckManager extends ItemManager<DeckProxy> implements IHasGam
|
||||
public final void paint(final Graphics g) {
|
||||
super.paint(g);
|
||||
|
||||
FSkin.drawImage(g, overActionIndex == 0 ? icoDeleteOver : icoDelete, 0, 0, imgSize, imgSize);
|
||||
FSkin.drawImage(g, overActionIndex == 1 ? icoEditOver : icoEdit, imgSize - 1, -1, imgSize, imgSize);
|
||||
FSkin.drawImage(g, /*overActionIndex == 0 ? icoDeleteOver : */icoDelete, 0, 0, imgSize, imgSize);
|
||||
FSkin.drawImage(g, /*overActionIndex == 0 ? icoDeleteOver : */icoEdit, imgSize - 1, -1, imgSize, imgSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import forge.ImageKeys;
|
||||
import forge.LobbyPlayer;
|
||||
import forge.card.CardRarity;
|
||||
import forge.card.CardRules;
|
||||
import forge.card.CardRulesPredicates;
|
||||
import forge.card.CardType;
|
||||
import forge.deck.Deck;
|
||||
import forge.game.GameRules;
|
||||
@@ -112,7 +111,7 @@ public class ConquestController {
|
||||
SGuiChoose.reveal(commander.getName() + " brought along " + Lang.nounWithAmount(newCards.size(), "new card"), newCards);
|
||||
}
|
||||
|
||||
private void playGame(final ConquestCommander commander, final int opponentIndex, final boolean isHumanDefending, final IVCommandCenter commandCenter) {
|
||||
/*private void playGame(final ConquestCommander commander, final int opponentIndex, final boolean isHumanDefending, final IVCommandCenter commandCenter) {
|
||||
gameRunner = new GameRunner(commander, opponentIndex, isHumanDefending, commandCenter);
|
||||
gameRunner.invokeAndWait();
|
||||
|
||||
@@ -120,7 +119,7 @@ public class ConquestController {
|
||||
if (gameRunner.wonGame) {
|
||||
}
|
||||
gameRunner = null;
|
||||
}
|
||||
}*/
|
||||
|
||||
public class GameRunner {
|
||||
private class Lock {
|
||||
@@ -131,6 +130,7 @@ public class ConquestController {
|
||||
public final ConquestCommander opponent;
|
||||
public final boolean isHumanDefending;
|
||||
private final IVCommandCenter commandCenter;
|
||||
@SuppressWarnings("unused")
|
||||
private boolean wonGame;
|
||||
|
||||
private GameRunner(final ConquestCommander commander0, final int opponentIndex, final boolean isHumanDefending0, final IVCommandCenter commandCenter0) {
|
||||
@@ -268,7 +268,7 @@ public class ConquestController {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean recruit(ConquestCommander commander) {
|
||||
/*private boolean recruit(ConquestCommander commander) {
|
||||
boolean bonusCard = Aggregates.randomInt(1, 100) <= FModel.getConquestPreferences().getPrefInt(CQPref.RECRUIT_BONUS_CARD_ODDS);
|
||||
return awardNewCards(model.getCurrentPlane().getCardPool().getAllCards(),
|
||||
commander.getName() + " recruited", "new creature", null, null,
|
||||
@@ -280,7 +280,7 @@ public class ConquestController {
|
||||
return awardNewCards(model.getCurrentPlane().getCardPool().getAllCards(),
|
||||
commander.getName() + " unlocked", "new spell", null, null,
|
||||
CardRulesPredicates.Presets.IS_NON_CREATURE_SPELL, bonusCard ? 2 : 1);
|
||||
}
|
||||
}*/
|
||||
|
||||
public void showGameRewards(final GameView game, final IWinLoseView<? extends IButton> view) {
|
||||
if (game.isMatchWonBy(humanPlayer)) {
|
||||
|
||||
@@ -10,6 +10,7 @@ import forge.planarconquest.ConquestPlane.Region;
|
||||
|
||||
public class ConquestOpponent {
|
||||
private final PaperCard commander;
|
||||
@SuppressWarnings("unused")
|
||||
private final Region region;
|
||||
private final ISkinImage mapIcon;
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import com.google.common.base.Predicate;
|
||||
import com.google.common.base.Predicates;
|
||||
import com.google.common.collect.Iterables;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import forge.card.CardRules;
|
||||
import forge.card.CardRulesPredicates;
|
||||
import forge.card.MagicColor;
|
||||
@@ -32,6 +33,7 @@ import forge.quest.data.QuestPreferences.QPref;
|
||||
import forge.util.Aggregates;
|
||||
import forge.util.MyRandom;
|
||||
import forge.util.PredicateString.StringOp;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -195,7 +197,7 @@ public final class BoosterUtils {
|
||||
if (i < colorBias) {
|
||||
|
||||
int index = (int) ((double) i / preferredBias);
|
||||
for (Byte ignored : otherColors) {
|
||||
for (@SuppressWarnings("unused") Byte ignored : otherColors) {
|
||||
|
||||
//Add artifacts here if there's no colorless selection
|
||||
if (i % 8 == 0 && !preferredColors.contains(MagicColor.COLORLESS) && includeArtifacts) {
|
||||
|
||||
Reference in New Issue
Block a user