Minor clean up

This commit is contained in:
tool4EvEr
2021-07-19 23:20:10 +02:00
parent bc854a0572
commit a1a326adc6
33 changed files with 198 additions and 253 deletions

View File

@@ -14,9 +14,9 @@ import forge.model.FModel;
public class CardThemedDeckGenerator extends DeckProxy implements Comparable<CardThemedDeckGenerator> {
public static List<DeckProxy> getMatrixDecks(GameFormat format, boolean isForAi){
final List<DeckProxy> decks = new ArrayList<>();
for(String card: CardArchetypeLDAGenerator.ldaPools.get(format.getName()).keySet()) {
for (String card: CardArchetypeLDAGenerator.ldaPools.get(format.getName()).keySet()) {
//exclude non AI playables as keycards for AI decks
if(isForAi&&FModel.getMagicDb().getCommonCards().getUniqueByName(card).getRules().getAiHints().getRemAIDecks()){
if (isForAi&&FModel.getMagicDb().getCommonCards().getUniqueByName(card).getRules().getAiHints().getRemAIDecks()) {
continue;
}
decks.add(new CardThemedDeckGenerator(card, format, isForAi));
@@ -42,7 +42,6 @@ public class CardThemedDeckGenerator extends DeckProxy implements Comparable<Car
return CardEdition.UNKNOWN;
}
@Override
public String getName() {
return name;

View File

@@ -153,8 +153,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
setCurrentPlayer(Iterables.getFirst(gameControllers.keySet(), null));
}
}
}
else {
} else {
gameControllers.put(player, gameController);
}
}
@@ -270,7 +269,7 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
private final Set<CardView> selectableCards = Sets.newHashSet();
public void setSelectables(final Iterable<CardView> cards) {
for ( CardView cv : cards ) { selectableCards.add(cv); }
for (CardView cv : cards) { selectableCards.add(cv); }
}
public void clearSelectables() {
selectableCards.clear();
@@ -285,12 +284,12 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
public void setgamePause(boolean pause) { gamePause = pause; }
public void pauseMatch() {
IGameController controller = spectator;
if(controller != null && !isGamePaused())
if (controller != null && !isGamePaused())
controller.selectButtonOk();
}
public void resumeMatch() {
IGameController controller = spectator;
if(controller != null && isGamePaused())
if (controller != null && isGamePaused())
controller.selectButtonOk();
}
@@ -315,12 +314,10 @@ public abstract class AbstractGuiGame implements IGuiGame, IMayViewCards {
// Concede each player on this Gui (except mind-controlled players)
c.concede();
}
}
else {
} else {
return false;
}
}
else {
} else {
return !ignoreConcedeChain;
}
if (gameView.isGameOver()) {

View File

@@ -392,8 +392,8 @@ public final class InputSelectTargets extends InputSyncronizedBase {
@Override
protected void onStop() {
getController().getGui().clearSelectables();
super.onStop();
getController().getGui().clearSelectables();
super.onStop();
}
}

View File

@@ -200,8 +200,7 @@ public class CardDetailUtil {
if (ptText.length() > 0) {
ptText.insert(0, "P/T: ");
ptText.append(" - ").append("Loy: ");
}
else {
} else {
ptText.append("Loyalty: ");
}
@@ -278,9 +277,9 @@ public class CardDetailUtil {
area.append("Token");
} else if (card.isTokenCard()) {
area.append("Token card");
} else if(card.isEmblem()) {
} else if (card.isEmblem()) {
area.append("Emblem");
} else if(card.isImmutable()) {
} else if (card.isImmutable()) {
area.append("Effect");
}
// card text
@@ -297,7 +296,6 @@ public class CardDetailUtil {
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(state.getName(), "") : null) :
card.getText(state, needTranslation ? CardTranslation.getTranslationTexts(card.getLeftSplitState().getName(), card.getRightSplitState().getName()) : null );
// LEVEL [0-9]+-[0-9]+
// LEVEL [0-9]+\+

View File

@@ -72,7 +72,7 @@ public final class CardScriptInfo {
final String filename = name.toLowerCase().replaceAll("[^-a-z0-9\\s]","").replaceAll("[-\\s]","_").replaceAll("__","_") + ".txt";
String[] folders = { String.valueOf(filename.charAt(0)), "upcoming"};
for(String folder : folders){
for (String folder : folders) {
final File file = new File(ForgeConstants.CARD_DATA_DIR + folder + File.separator + filename);
if (file.exists()) {
script = new CardScriptInfo(FileUtil.readFileToString(file), file);

View File

@@ -104,7 +104,7 @@ public final class GamePlayerUtil {
final String oldPlayerName = FModel.getPreferences().getPref(FPref.PLAYER_NAME);
String newPlayerName;
try{
try {
if (StringUtils.isBlank(oldPlayerName)) {
newPlayerName = getVerifiedPlayerName(getPlayerNameUsingFirstTimePrompt(), oldPlayerName);
} else {

View File

@@ -277,8 +277,6 @@ public class HumanCostDecision extends CostDecisionMakerBase {
return exileFromSame(cost, list, c, payableZone);
}
// Inputs
// Exile<Num/Type{/TypeDescription}>

View File

@@ -334,7 +334,6 @@ public class PlayerControllerHuman extends PlayerController implements IGameCont
String errMsg;
if (newMain.size() < deckMinSize) {
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooFewCardsMainDeck", String.valueOf(deckMinSize)));
} else {
errMsg = TextUtil.concatNoSpace(localizer.getMessage("lblTooManyCardsSideboard", String.valueOf(sbMax)));
}