Refactor: Remove unused subscribe method from CardRepository (#9243)

This commit is contained in:
DeepCrimson 2022-07-27 05:02:59 -07:00 committed by GitHub
parent 14485ae635
commit 5d11bab6dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,7 +12,6 @@ import com.j256.ormlite.table.TableUtils;
import mage.constants.CardType;
import mage.constants.SetType;
import mage.constants.SuperType;
import mage.game.events.Listener;
import mage.util.RandomUtil;
import org.apache.log4j.Logger;
@ -37,7 +36,6 @@ public enum CardRepository {
private static final long CARD_CONTENT_VERSION = 241;
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
private final RepositoryEventSource eventSource = new RepositoryEventSource();
public static final Set<String> snowLandSetCodes = new HashSet<>(Arrays.asList(
"CSP",
@ -65,16 +63,11 @@ public enum CardRepository {
TableUtils.createTableIfNotExists(connectionSource, CardInfo.class);
cardDao = DaoManager.createDao(connectionSource, CardInfo.class);
eventSource.fireRepositoryDbLoaded();
} catch (SQLException ex) {
Logger.getLogger(CardRepository.class).error("Error creating card repository - ", ex);
}
}
public void subscribe(Listener<RepositoryEvent> listener) {
eventSource.addListener(listener);
}
public void saveCards(final List<CardInfo> newCards, long newContentVersion) {
try {
cardDao.callBatchTasks(() -> {
@ -99,7 +92,6 @@ public enum CardRepository {
});
setContentVersion(newContentVersion);
eventSource.fireRepositoryDbUpdated();
} catch (Exception ex) {
//
}