mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Cleanup - .equals("") -> .isEmpty()
This commit is contained in:
@@ -2591,7 +2591,7 @@ public class ComputerUtil {
|
|||||||
chosen = b;
|
chosen = b;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (chosen.equals("")) {
|
if (chosen.isEmpty()) {
|
||||||
for (String b : basics) {
|
for (String b : basics) {
|
||||||
if (Iterables.any(possibleCards, CardPredicates.isType(b))) {
|
if (Iterables.any(possibleCards, CardPredicates.isType(b))) {
|
||||||
chosen = b;
|
chosen = b;
|
||||||
|
|||||||
@@ -421,7 +421,7 @@ public class ComputerUtilCombat {
|
|||||||
final List<Card> blockers = combat.getBlockers(attacker);
|
final List<Card> blockers = combat.getBlockers(attacker);
|
||||||
|
|
||||||
if (blockers.isEmpty()) {
|
if (blockers.isEmpty()) {
|
||||||
if (!attacker.getSVar("MustBeBlocked").equals("")) {
|
if (!attacker.getSVar("MustBeBlocked").isEmpty()) {
|
||||||
boolean cond = false;
|
boolean cond = false;
|
||||||
String condVal = attacker.getSVar("MustBeBlocked");
|
String condVal = attacker.getSVar("MustBeBlocked");
|
||||||
boolean isAttackingPlayer = combat.getDefenderByAttacker(attacker) instanceof Player;
|
boolean isAttackingPlayer = combat.getDefenderByAttacker(attacker) instanceof Player;
|
||||||
@@ -490,7 +490,7 @@ public class ComputerUtilCombat {
|
|||||||
final List<Card> blockers = combat.getBlockers(attacker);
|
final List<Card> blockers = combat.getBlockers(attacker);
|
||||||
|
|
||||||
if (blockers.isEmpty()) {
|
if (blockers.isEmpty()) {
|
||||||
if (!attacker.getSVar("MustBeBlocked").equals("")) {
|
if (!attacker.getSVar("MustBeBlocked").isEmpty()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1040,7 +1040,7 @@ public class ComputerUtilMana {
|
|||||||
// If it's a low priority spell (it's explicitly marked so elsewhere in the AI with a SVar), always
|
// If it's a low priority spell (it's explicitly marked so elsewhere in the AI with a SVar), always
|
||||||
// obey mana reservations for Main 2; otherwise, obey mana reservations depending on the "chance to reserve"
|
// obey mana reservations for Main 2; otherwise, obey mana reservations depending on the "chance to reserve"
|
||||||
// AI profile variable.
|
// AI profile variable.
|
||||||
if (sa.getSVar("LowPriorityAI").equals("")) {
|
if (sa.getSVar("LowPriorityAI").isEmpty()) {
|
||||||
if (chanceToReserve == 0 || MyRandom.getRandom().nextInt(100) >= chanceToReserve) {
|
if (chanceToReserve == 0 || MyRandom.getRandom().nextInt(100) >= chanceToReserve) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ public class ChooseCardAi extends SpellAbilityAi {
|
|||||||
logic = logic.replace("NotSelf", "");
|
logic = logic.replace("NotSelf", "");
|
||||||
}
|
}
|
||||||
Card choice = null;
|
Card choice = null;
|
||||||
if (logic.equals("")) {
|
if (logic.isEmpty()) {
|
||||||
// Base Logic is choose "best"
|
// Base Logic is choose "best"
|
||||||
choice = ComputerUtilCard.getBestAI(options);
|
choice = ComputerUtilCard.getBestAI(options);
|
||||||
} else if ("WorstCard".equals(logic)) {
|
} else if ("WorstCard".equals(logic)) {
|
||||||
|
|||||||
@@ -337,7 +337,7 @@ public final class ImageKeys {
|
|||||||
File f = new File(lookupDirectory);
|
File f = new File(lookupDirectory);
|
||||||
if (f.exists() && f.isDirectory()) {
|
if (f.exists() && f.isDirectory()) {
|
||||||
for (String ext : FILE_EXTENSIONS) {
|
for (String ext : FILE_EXTENSIONS) {
|
||||||
if (ext.equals(""))
|
if (ext.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
File placeholder;
|
File placeholder;
|
||||||
String fb1 = fullborderFile.replace(setKey+"/","")+ext;
|
String fb1 = fullborderFile.replace(setKey+"/","")+ext;
|
||||||
@@ -371,7 +371,7 @@ public final class ImageKeys {
|
|||||||
private static File findFile(String dir, String filename) {
|
private static File findFile(String dir, String filename) {
|
||||||
if (dir.equals(CACHE_CARD_PICS_DIR)) {
|
if (dir.equals(CACHE_CARD_PICS_DIR)) {
|
||||||
for (String ext : FILE_EXTENSIONS) {
|
for (String ext : FILE_EXTENSIONS) {
|
||||||
if (ext.equals(""))
|
if (ext.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
File f = new File(dir, filename + ext);
|
File f = new File(dir, filename + ext);
|
||||||
|
|||||||
@@ -550,7 +550,7 @@ public class Deck extends DeckBase implements Iterable<Entry<DeckSection, CardPo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setAiHints(String aiHintsInfo) {
|
public void setAiHints(String aiHintsInfo) {
|
||||||
if (aiHintsInfo == null || aiHintsInfo.trim().equals("")) {
|
if (aiHintsInfo == null || aiHintsInfo.trim().isEmpty()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String[] hints = aiHintsInfo.split("\\|");
|
String[] hints = aiHintsInfo.split("\\|");
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public abstract class DeckBase implements Serializable, Comparable<DeckBase>, In
|
|||||||
public void setName(String deckName) { this.name = deckName; }
|
public void setName(String deckName) { this.name = deckName; }
|
||||||
|
|
||||||
public boolean hasName() {
|
public boolean hasName() {
|
||||||
return !(this.name.equals(""));
|
return !(this.name.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDirectory() {
|
public String getDirectory() {
|
||||||
|
|||||||
@@ -111,13 +111,13 @@ public class DeckRecognizer {
|
|||||||
// WARNING MESSAGES
|
// WARNING MESSAGES
|
||||||
// ================
|
// ================
|
||||||
public static Token UnknownCard(final String cardName, final String setCode, final int count) {
|
public static Token UnknownCard(final String cardName, final String setCode, final int count) {
|
||||||
String ttext = setCode == null || setCode.equals("") ? cardName :
|
String ttext = setCode == null || setCode.isEmpty() ? cardName :
|
||||||
String.format("%s [%s]", cardName, setCode);
|
String.format("%s [%s]", cardName, setCode);
|
||||||
return new Token(TokenType.UNKNOWN_CARD, count, ttext);
|
return new Token(TokenType.UNKNOWN_CARD, count, ttext);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Token UnsupportedCard(final String cardName, final String setCode, final int count) {
|
public static Token UnsupportedCard(final String cardName, final String setCode, final int count) {
|
||||||
String ttext = setCode == null || setCode.equals("") ? cardName :
|
String ttext = setCode == null || setCode.isEmpty() ? cardName :
|
||||||
String.format("%s [%s]", cardName, setCode);
|
String.format("%s [%s]", cardName, setCode);
|
||||||
return new Token(TokenType.UNSUPPORTED_CARD, count, ttext);
|
return new Token(TokenType.UNSUPPORTED_CARD, count, ttext);
|
||||||
}
|
}
|
||||||
@@ -846,7 +846,7 @@ public class DeckRecognizer {
|
|||||||
}
|
}
|
||||||
if (isCardRarity(text)){
|
if (isCardRarity(text)){
|
||||||
String tokenText = cardRarityTokenMatch(text);
|
String tokenText = cardRarityTokenMatch(text);
|
||||||
if (tokenText != null && !tokenText.trim().equals(""))
|
if (tokenText != null && !tokenText.trim().isEmpty())
|
||||||
return new Token(TokenType.CARD_RARITY, tokenText);
|
return new Token(TokenType.CARD_RARITY, tokenText);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -251,7 +251,7 @@ public class CardTranslation {
|
|||||||
public static void buildOracleMapping(String faceName, String oracleText) {
|
public static void buildOracleMapping(String faceName, String oracleText) {
|
||||||
if (!needsTranslation() || oracleMappings.containsKey(faceName)) return;
|
if (!needsTranslation() || oracleMappings.containsKey(faceName)) return;
|
||||||
String translatedText = getTranslatedOracle(faceName);
|
String translatedText = getTranslatedOracle(faceName);
|
||||||
if (translatedText.equals("")) {
|
if (translatedText.isEmpty()) {
|
||||||
// english card only, fall back
|
// english card only, fall back
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2470,7 +2470,7 @@ public class GameAction {
|
|||||||
Localizer.getInstance().getMessage("lblMilledToZone", destination.getTranslatedName()) + ")";
|
Localizer.getInstance().getMessage("lblMilledToZone", destination.getTranslatedName()) + ")";
|
||||||
if (showRevealDialog) {
|
if (showRevealDialog) {
|
||||||
final String message = Localizer.getInstance().getMessage("lblMilledCards");
|
final String message = Localizer.getInstance().getMessage("lblMilledCards");
|
||||||
final boolean addSuffix = !toZoneStr.equals("");
|
final boolean addSuffix = !toZoneStr.isEmpty();
|
||||||
game.getAction().reveal(milledPlayer, destination, p, false, message, addSuffix);
|
game.getAction().reveal(milledPlayer, destination, p, false, message, addSuffix);
|
||||||
}
|
}
|
||||||
game.getGameLog().add(GameLogEntryType.ZONE_CHANGE, p + " milled " +
|
game.getGameLog().add(GameLogEntryType.ZONE_CHANGE, p + " milled " +
|
||||||
|
|||||||
@@ -485,7 +485,7 @@ public class AbilityUtils {
|
|||||||
} else if (calcX[0].startsWith("PlayerCount")) {
|
} else if (calcX[0].startsWith("PlayerCount")) {
|
||||||
final String hType = calcX[0].substring(11);
|
final String hType = calcX[0].substring(11);
|
||||||
final FCollection<Player> players = new FCollection<>();
|
final FCollection<Player> players = new FCollection<>();
|
||||||
if (hType.equals("Players") || hType.equals("")) {
|
if (hType.equals("Players") || hType.isEmpty()) {
|
||||||
players.addAll(game.getPlayers());
|
players.addAll(game.getPlayers());
|
||||||
val = playerXCount(players, calcX[1], card, ability);
|
val = playerXCount(players, calcX[1], card, ability);
|
||||||
} else if (hType.equals("YourTeam")) {
|
} else if (hType.equals("YourTeam")) {
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ public abstract class SpellAbilityEffect {
|
|||||||
String trigStr = "Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield " +
|
String trigStr = "Mode$ Phase | Phase$ End of Turn | TriggerZones$ Battlefield " +
|
||||||
"| TriggerDescription$ At the beginning of" + whose + "end step, " + location.toLowerCase()
|
"| TriggerDescription$ At the beginning of" + whose + "end step, " + location.toLowerCase()
|
||||||
+ " CARDNAME.";
|
+ " CARDNAME.";
|
||||||
if (!player.equals("")) {
|
if (!player.isEmpty()) {
|
||||||
trigStr += " | Player$ " + player;
|
trigStr += " | Player$ " + player;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1078,7 +1078,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
searchedLibrary = false;
|
searchedLibrary = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!defined && !changeType.equals("") && !changeType.startsWith("EACH")) {
|
if (!defined && !changeType.isEmpty() && !changeType.startsWith("EACH")) {
|
||||||
fetchList = (CardCollection)AbilityUtils.filterListByType(fetchList, sa.getParam("ChangeType"), sa);
|
fetchList = (CardCollection)AbilityUtils.filterListByType(fetchList, sa.getParam("ChangeType"), sa);
|
||||||
}
|
}
|
||||||
fetchList.sort();
|
fetchList.sort();
|
||||||
@@ -1481,7 +1481,7 @@ public class ChangeZoneEffect extends SpellAbilityEffect {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (((!ZoneType.Battlefield.equals(destination) && !changeType.equals("") && !defined && !changeType.equals("Card"))
|
if (((!ZoneType.Battlefield.equals(destination) && !changeType.isEmpty() && !defined && !changeType.equals("Card"))
|
||||||
|| (sa.hasParam("Reveal") && !movedCards.isEmpty())) && !sa.hasParam("NoReveal")) {
|
|| (sa.hasParam("Reveal") && !movedCards.isEmpty())) && !sa.hasParam("NoReveal")) {
|
||||||
game.getAction().reveal(movedCards, player);
|
game.getAction().reveal(movedCards, player);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ public class ChooseCardEffect extends SpellAbilityEffect {
|
|||||||
} else if (value.equals("ChosenType")) {
|
} else if (value.equals("ChosenType")) {
|
||||||
tag = host.getChosenType();
|
tag = host.getChosenType();
|
||||||
}
|
}
|
||||||
if (!tag.equals("")) {
|
if (!tag.isEmpty()) {
|
||||||
title = title + " (" + tag +")";
|
title = title + " (" + tag +")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -690,7 +690,7 @@ public class CountersPutEffect extends SpellAbilityEffect {
|
|||||||
protected CounterType chooseTypeFromList(SpellAbility sa, String list, GameEntity obj, PlayerController pc) {
|
protected CounterType chooseTypeFromList(SpellAbility sa, String list, GameEntity obj, PlayerController pc) {
|
||||||
List<CounterType> choices = Lists.newArrayList();
|
List<CounterType> choices = Lists.newArrayList();
|
||||||
for (String s : list.split(",")) {
|
for (String s : list.split(",")) {
|
||||||
if (!s.equals("") && (!sa.hasParam("UniqueType") || obj.getCounters(CounterType.getType(s)) == 0)) {
|
if (!s.isEmpty() && (!sa.hasParam("UniqueType") || obj.getCounters(CounterType.getType(s)) == 0)) {
|
||||||
CounterType type = CounterType.getType(s);
|
CounterType type = CounterType.getType(s);
|
||||||
if (!choices.contains(type)) {
|
if (!choices.contains(type)) {
|
||||||
choices.add(type);
|
choices.add(type);
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ public class MakeCardEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
for (final String name : names) {
|
for (final String name : names) {
|
||||||
int toMake = amount;
|
int toMake = amount;
|
||||||
if (!name.equals("")) {
|
if (!name.isEmpty()) {
|
||||||
while (toMake > 0) {
|
while (toMake > 0) {
|
||||||
PaperCard pc;
|
PaperCard pc;
|
||||||
if (pack != null) {
|
if (pack != null) {
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ public class PeekAndRevealEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
sb.append(who.equals("") ? peeker : who);
|
sb.append(who.isEmpty() ? peeker : who);
|
||||||
sb.append(verb).append("the top ");
|
sb.append(verb).append("the top ");
|
||||||
sb.append(numPeek > 1 ? Lang.getNumeral(numPeek) + " cards " : "card ").append("of ").append(whose);
|
sb.append(numPeek > 1 ? Lang.getNumeral(numPeek) + " cards " : "card ").append("of ").append(whose);
|
||||||
sb.append(" library.");
|
sb.append(" library.");
|
||||||
|
|||||||
@@ -82,7 +82,7 @@ public class ProtectAllEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
// Deal with permanents
|
// Deal with permanents
|
||||||
final String valid = sa.getParamOrDefault("ValidCards", "");
|
final String valid = sa.getParamOrDefault("ValidCards", "");
|
||||||
if (!valid.equals("")) {
|
if (!valid.isEmpty()) {
|
||||||
CardCollectionView list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), valid, sa.getActivatingPlayer(), host, sa);
|
CardCollectionView list = CardLists.getValidCards(game.getCardsIn(ZoneType.Battlefield), valid, sa.getActivatingPlayer(), host, sa);
|
||||||
|
|
||||||
for (final Card tgtC : list) {
|
for (final Card tgtC : list) {
|
||||||
@@ -107,7 +107,7 @@ public class ProtectAllEffect extends SpellAbilityEffect {
|
|||||||
|
|
||||||
// Deal with Players
|
// Deal with Players
|
||||||
final String players = sa.getParamOrDefault("ValidPlayers", "");
|
final String players = sa.getParamOrDefault("ValidPlayers", "");
|
||||||
if (!players.equals("")) {
|
if (!players.isEmpty()) {
|
||||||
for (final Player player : AbilityUtils.getDefinedPlayers(host, players, sa)) {
|
for (final Player player : AbilityUtils.getDefinedPlayers(host, players, sa)) {
|
||||||
player.addChangedKeywords(gainsKWList, ImmutableList.of(), timestamp, 0);
|
player.addChangedKeywords(gainsKWList, ImmutableList.of(), timestamp, 0);
|
||||||
|
|
||||||
|
|||||||
@@ -2809,7 +2809,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
for (final StaticAbility stAb : state.getStaticAbilities()) {
|
for (final StaticAbility stAb : state.getStaticAbilities()) {
|
||||||
if (!stAb.isSecondary() && !stAb.isClassAbility()) {
|
if (!stAb.isSecondary() && !stAb.isClassAbility()) {
|
||||||
final String stAbD = stAb.toString();
|
final String stAbD = stAb.toString();
|
||||||
if (!stAbD.equals("")) {
|
if (!stAbD.isEmpty()) {
|
||||||
boolean disabled = getGame() != null && getController() != null && game.getAge() != GameStage.Play && !stAb.checkConditions();
|
boolean disabled = getGame() != null && getController() != null && game.getAge() != GameStage.Play && !stAb.checkConditions();
|
||||||
if (disabled) sb.append(grayTag);
|
if (disabled) sb.append(grayTag);
|
||||||
sb.append(stAbD);
|
sb.append(stAbD);
|
||||||
@@ -3187,7 +3187,7 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
for (final StaticAbility stAb : state.getStaticAbilities()) {
|
for (final StaticAbility stAb : state.getStaticAbilities()) {
|
||||||
if (!stAb.isSecondary()) {
|
if (!stAb.isSecondary()) {
|
||||||
final String stAbD = stAb.toString();
|
final String stAbD = stAb.toString();
|
||||||
if (!stAbD.equals("")) {
|
if (!stAbD.isEmpty()) {
|
||||||
sb.append(stAbD).append("\r\n");
|
sb.append(stAbD).append("\r\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -683,7 +683,7 @@ public class CardFactoryUtil {
|
|||||||
}
|
}
|
||||||
|
|
||||||
String repeffstr = "Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield "
|
String repeffstr = "Event$ Moved | ValidCard$ Card.Self | Destination$ Battlefield "
|
||||||
+ "| Secondary$ True | ReplacementResult$ Updated | Description$ " + desc + (!extraparams.equals("") ? " | " + extraparams : "");
|
+ "| Secondary$ True | ReplacementResult$ Updated | Description$ " + desc + (!extraparams.isEmpty() ? " | " + extraparams : "");
|
||||||
|
|
||||||
ReplacementEffect re = ReplacementHandler.parseReplacement(repeffstr, card.getCard(), intrinsic, card);
|
ReplacementEffect re = ReplacementHandler.parseReplacement(repeffstr, card.getCard(), intrinsic, card);
|
||||||
|
|
||||||
|
|||||||
@@ -254,8 +254,8 @@ public class Cost implements Serializable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (parsedMana == null && (manaParts.length() > 0 || !xMin.equals(""))) {
|
if (parsedMana == null && (manaParts.length() > 0 || !xMin.isEmpty())) {
|
||||||
parsedMana = new CostPartMana(new ManaCost(new ManaCostParser(manaParts.toString())), xMin.equals("") ? null : xMin);
|
parsedMana = new CostPartMana(new ManaCost(new ManaCostParser(manaParts.toString())), xMin.isEmpty() ? null : xMin);
|
||||||
}
|
}
|
||||||
if (parsedMana != null) {
|
if (parsedMana != null) {
|
||||||
costParts.add(parsedMana);
|
costParts.add(parsedMana);
|
||||||
|
|||||||
@@ -782,7 +782,7 @@ public abstract class SpellAbility extends CardTraitBase implements ISpellAbilit
|
|||||||
// Thus, to protect the original's set from changes, we make a copy right here.
|
// Thus, to protect the original's set from changes, we make a copy right here.
|
||||||
optionalCosts = EnumSet.copyOf(optionalCosts);
|
optionalCosts = EnumSet.copyOf(optionalCosts);
|
||||||
optionalCosts.add(cost);
|
optionalCosts.add(cost);
|
||||||
if (!cost.getPip().equals("")) {
|
if (!cost.getPip().isEmpty()) {
|
||||||
pipsToReduce.add(cost.getPip());
|
pipsToReduce.add(cost.getPip());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -84,15 +84,15 @@ public class StackItemView extends TrackableObject implements IHasCardView {
|
|||||||
if (kicked && !generic)
|
if (kicked && !generic)
|
||||||
OptionalCostString += "Kicked";
|
OptionalCostString += "Kicked";
|
||||||
if (entwined)
|
if (entwined)
|
||||||
OptionalCostString += OptionalCostString.equals("") ? "Entwined" : ", Entwined";
|
OptionalCostString += OptionalCostString.isEmpty() ? "Entwined" : ", Entwined";
|
||||||
if (buyback)
|
if (buyback)
|
||||||
OptionalCostString += OptionalCostString.equals("") ? "Buyback" : ", Buyback";
|
OptionalCostString += OptionalCostString.isEmpty() ? "Buyback" : ", Buyback";
|
||||||
if (retraced)
|
if (retraced)
|
||||||
OptionalCostString += OptionalCostString.equals("") ? "Retraced" : ", Retraced";
|
OptionalCostString += OptionalCostString.isEmpty() ? "Retraced" : ", Retraced";
|
||||||
if (jumpstart)
|
if (jumpstart)
|
||||||
OptionalCostString += OptionalCostString.equals("") ? "Jumpstart" : ", Jumpstart";
|
OptionalCostString += OptionalCostString.isEmpty() ? "Jumpstart" : ", Jumpstart";
|
||||||
if (additional || generic)
|
if (additional || generic)
|
||||||
OptionalCostString += OptionalCostString.equals("") ? "Additional" : ", Additional";
|
OptionalCostString += OptionalCostString.isEmpty() ? "Additional" : ", Additional";
|
||||||
}
|
}
|
||||||
set(TrackableProperty.OptionalCosts, OptionalCostString);
|
set(TrackableProperty.OptionalCosts, OptionalCostString);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -202,7 +202,7 @@ public abstract class Trigger extends TriggerReplacementBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (saDesc.equals("")) { // in case we haven't found anything better
|
if (saDesc.isEmpty()) { // in case we haven't found anything better
|
||||||
saDesc = sa.toString();
|
saDesc = sa.toString();
|
||||||
}
|
}
|
||||||
// string might have leading whitespace
|
// string might have leading whitespace
|
||||||
|
|||||||
@@ -185,14 +185,14 @@ public class ImageCache {
|
|||||||
}
|
}
|
||||||
if (altState)
|
if (altState)
|
||||||
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
|
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
|
||||||
if (!specColor.equals(""))
|
if (!specColor.isEmpty())
|
||||||
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
|
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
|
||||||
if (imageKey.startsWith(ImageKeys.CARD_PREFIX)) {
|
if (imageKey.startsWith(ImageKeys.CARD_PREFIX)) {
|
||||||
ipc = ImageUtil.getPaperCardFromImageKey(imageKey);
|
ipc = ImageUtil.getPaperCardFromImageKey(imageKey);
|
||||||
if (ipc != null) {
|
if (ipc != null) {
|
||||||
if (altState) {
|
if (altState) {
|
||||||
imageKey = ipc.getCardAltImageKey();
|
imageKey = ipc.getCardAltImageKey();
|
||||||
} else if (!specColor.equals("")) {
|
} else if (!specColor.isEmpty()) {
|
||||||
switch (specColor) {
|
switch (specColor) {
|
||||||
case "white":
|
case "white":
|
||||||
imageKey = ipc.getCardWSpecImageKey();
|
imageKey = ipc.getCardWSpecImageKey();
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ public class DeckImport<TModel extends DeckBase> extends FDialog {
|
|||||||
// we set it to the current one (if any) or set a new one.
|
// we set it to the current one (if any) or set a new one.
|
||||||
// In this way, if this deck will replace the current one, the name will be kept the same!
|
// In this way, if this deck will replace the current one, the name will be kept the same!
|
||||||
if (!deck.hasName()){
|
if (!deck.hasName()){
|
||||||
if (currentDeckName.equals(""))
|
if (currentDeckName.isEmpty())
|
||||||
deck.setName(Localizer.getInstance().getMessage("lblNewDeckName"));
|
deck.setName(Localizer.getInstance().getMessage("lblNewDeckName"));
|
||||||
else
|
else
|
||||||
deck.setName(currentDeckName);
|
deck.setName(currentDeckName);
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public class DeckController<T extends DeckBase> {
|
|||||||
newModel();
|
newModel();
|
||||||
isStored = false;
|
isStored = false;
|
||||||
} else
|
} else
|
||||||
isStored = !this.modelPath.equals("");
|
isStored = !this.modelPath.isEmpty();
|
||||||
} else {
|
} else {
|
||||||
CardPool catalogClone = new CardPool(view.getInitialCatalog());
|
CardPool catalogClone = new CardPool(view.getInitialCatalog());
|
||||||
deck = pickFromCatalog(deck, catalogClone);
|
deck = pickFromCatalog(deck, catalogClone);
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ public final class FImageUtil {
|
|||||||
PaperCard card = ImageUtil.getPaperCardFromImageKey(key);
|
PaperCard card = ImageUtil.getPaperCardFromImageKey(key);
|
||||||
if (altState) {
|
if (altState) {
|
||||||
imageKey = card.getCardAltImageKey();
|
imageKey = card.getCardAltImageKey();
|
||||||
} else if (!specColor.equals("")) {
|
} else if (!specColor.isEmpty()) {
|
||||||
switch (specColor) {
|
switch (specColor) {
|
||||||
case "white":
|
case "white":
|
||||||
imageKey = card.getCardWSpecImageKey();
|
imageKey = card.getCardWSpecImageKey();
|
||||||
@@ -119,7 +119,7 @@ public final class FImageUtil {
|
|||||||
if(altState) {
|
if(altState) {
|
||||||
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
|
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.BACKFACE_POSTFIX.length());
|
||||||
imageKey += "full.jpg";
|
imageKey += "full.jpg";
|
||||||
} else if (!specColor.equals("")) {
|
} else if (!specColor.isEmpty()) {
|
||||||
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
|
imageKey = imageKey.substring(0, imageKey.length() - ImageKeys.SPECFACE_W.length());
|
||||||
imageKey += "full.jpg";
|
imageKey += "full.jpg";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -861,7 +861,7 @@ public class AdventurePlayer implements Serializable, SaveFileContent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void removeItem(String name) {
|
public void removeItem(String name) {
|
||||||
if (name == null || name.equals("")) return;
|
if (name == null || name.isEmpty()) return;
|
||||||
inventoryItems.removeValue(name, false);
|
inventoryItems.removeValue(name, false);
|
||||||
if (equippedItems.values().contains(name) && !inventoryItems.contains(name, false)) {
|
if (equippedItems.values().contains(name) && !inventoryItems.contains(name, false)) {
|
||||||
equippedItems.values().remove(name);
|
equippedItems.values().remove(name);
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ public class InventoryScene extends UIScene {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
String item = Current.player().itemInSlot(slotName);
|
String item = Current.player().itemInSlot(slotName);
|
||||||
if (item != null && !item.equals("")) {
|
if (item != null && !item.isEmpty()) {
|
||||||
Button changeButton = null;
|
Button changeButton = null;
|
||||||
for (Button invButton : inventoryButtons) {
|
for (Button invButton : inventoryButtons) {
|
||||||
if (itemLocation.get(invButton) != null && itemLocation.get(invButton).equals(item)) {
|
if (itemLocation.get(invButton) != null && itemLocation.get(invButton).equals(item)) {
|
||||||
@@ -246,7 +246,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if (Current.player().getShards() < data.shardsNeeded)
|
if (Current.player().getShards() < data.shardsNeeded)
|
||||||
useButton.setDisabled(true);
|
useButton.setDisabled(true);
|
||||||
|
|
||||||
if (data.equipmentSlot == null || data.equipmentSlot.equals("")) {
|
if (data.equipmentSlot == null || data.equipmentSlot.isEmpty()) {
|
||||||
equipButton.setDisabled(true);
|
equipButton.setDisabled(true);
|
||||||
} else {
|
} else {
|
||||||
equipButton.setDisabled(false);
|
equipButton.setDisabled(false);
|
||||||
@@ -380,7 +380,7 @@ public class InventoryScene extends UIScene {
|
|||||||
if (slot.getValue().getChildren().size >= 2)
|
if (slot.getValue().getChildren().size >= 2)
|
||||||
slot.getValue().removeActorAt(1, false);
|
slot.getValue().removeActorAt(1, false);
|
||||||
String equippedItem = Current.player().itemInSlot(slot.getKey());
|
String equippedItem = Current.player().itemInSlot(slot.getKey());
|
||||||
if (equippedItem == null || equippedItem.equals(""))
|
if (equippedItem == null || equippedItem.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
ItemData item = ItemData.getItem(equippedItem);
|
ItemData item = ItemData.getItem(equippedItem);
|
||||||
if (item != null) {
|
if (item != null) {
|
||||||
|
|||||||
@@ -295,7 +295,7 @@ public class GameHUD extends Stage {
|
|||||||
updatelife = true;
|
updatelife = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!lifepointsTextColor.equals("")) {
|
if (!lifepointsTextColor.isEmpty()) {
|
||||||
lifepointsTextColor = "";
|
lifepointsTextColor = "";
|
||||||
updatelife = true;
|
updatelife = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -701,7 +701,7 @@ public class MapStage extends GameStage {
|
|||||||
filteredPossibleShops = possibleShops;
|
filteredPossibleShops = possibleShops;
|
||||||
}
|
}
|
||||||
Array<ShopData> shops;
|
Array<ShopData> shops;
|
||||||
if (filteredPossibleShops.size == 0 || shopList.equals(""))
|
if (filteredPossibleShops.size == 0 || shopList.isEmpty())
|
||||||
shops = WorldData.getShopList();
|
shops = WorldData.getShopList();
|
||||||
else {
|
else {
|
||||||
shops = new Array<>();
|
shops = new Array<>();
|
||||||
|
|||||||
@@ -1184,7 +1184,7 @@ public class MatchScreen extends FScreen {
|
|||||||
private boolean hasActivePlane() {
|
private boolean hasActivePlane() {
|
||||||
if (MatchController.instance.getGameView() != null)
|
if (MatchController.instance.getGameView() != null)
|
||||||
if (MatchController.instance.getGameView().getPlanarPlayer() != null) {
|
if (MatchController.instance.getGameView().getPlanarPlayer() != null) {
|
||||||
return !MatchController.instance.getGameView().getPlanarPlayer().getCurrentPlaneName().equals("");
|
return !MatchController.instance.getGameView().getPlanarPlayer().getCurrentPlaneName().isEmpty();
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -380,7 +380,7 @@ public class VStack extends FDropDown {
|
|||||||
int index = text.indexOf(name);
|
int index = text.indexOf(name);
|
||||||
String newtext = "";
|
String newtext = "";
|
||||||
String cId = "(" + sourceCard.getId() + ")";
|
String cId = "(" + sourceCard.getId() + ")";
|
||||||
String optionalCostString = !stackInstance.getOptionalCostString().equals("") ? " ("+ stackInstance.getOptionalCostString() + ")" : "";
|
String optionalCostString = !stackInstance.getOptionalCostString().isEmpty() ? " ("+ stackInstance.getOptionalCostString() + ")" : "";
|
||||||
|
|
||||||
if (index == -1) {
|
if (index == -1) {
|
||||||
newtext = TextUtil.fastReplace(text.trim(), " ", " ");
|
newtext = TextUtil.fastReplace(text.trim(), " ", " ");
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ public class SettingsPage extends TabPage<SettingsScreen> {
|
|||||||
public void valueChanged(String newValue) {
|
public void valueChanged(String newValue) {
|
||||||
// if the new locale needs to use CJK font, disallow change if UI_CJK_FONT is not set yet
|
// if the new locale needs to use CJK font, disallow change if UI_CJK_FONT is not set yet
|
||||||
ForgePreferences prefs = FModel.getPreferences();
|
ForgePreferences prefs = FModel.getPreferences();
|
||||||
if (prefs.getPref(FPref.UI_CJK_FONT).equals("") &&
|
if (prefs.getPref(FPref.UI_CJK_FONT).isEmpty() &&
|
||||||
(newValue.equals("zh-CN") || newValue.equals("ja-JP"))) {
|
(newValue.equals("zh-CN") || newValue.equals("ja-JP"))) {
|
||||||
String message = "Please download CJK font (from \"Files\"), and set it before change language.";
|
String message = "Please download CJK font (from \"Files\"), and set it before change language.";
|
||||||
if (newValue.equals("zh-CN")) {
|
if (newValue.equals("zh-CN")) {
|
||||||
|
|||||||
Reference in New Issue
Block a user