Assigning lstDecks.getGameType().getDeckFormat() to a variable so we don't have to write it out each conditional

This commit is contained in:
austinio7116
2018-02-23 18:43:15 +00:00
committed by maustin
parent c047ec8588
commit 9cb1f2787c

View File

@@ -131,9 +131,10 @@ public class FDeckChooser extends JPanel implements IDecksComboBoxListener {
} }
private void updateCustom() { private void updateCustom() {
if(lstDecks.getGameType().getDeckFormat().equals(DeckFormat.Commander)){ DeckFormat deckFormat = lstDecks.getGameType().getDeckFormat();
if(deckFormat.equals(DeckFormat.Commander)){
updateDecks(DeckProxy.getAllCommanderDecks(), ItemManagerConfig.COMMANDER_DECKS); updateDecks(DeckProxy.getAllCommanderDecks(), ItemManagerConfig.COMMANDER_DECKS);
}else if(lstDecks.getGameType().getDeckFormat().equals(DeckFormat.TinyLeaders)){ }else if(deckFormat.equals(DeckFormat.TinyLeaders)){
updateDecks(DeckProxy.getAllTinyLeadersDecks(), ItemManagerConfig.COMMANDER_DECKS); updateDecks(DeckProxy.getAllTinyLeadersDecks(), ItemManagerConfig.COMMANDER_DECKS);
}else { }else {
updateDecks(DeckProxy.getAllConstructedDecks(), ItemManagerConfig.CONSTRUCTED_DECKS); updateDecks(DeckProxy.getAllConstructedDecks(), ItemManagerConfig.CONSTRUCTED_DECKS);