mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
Refactor: Delete Unused Methods cardExists (#9244)
This commit is contained in:
parent
05648f8c0c
commit
f20210037b
1 changed files with 0 additions and 35 deletions
|
@ -10,7 +10,6 @@ import com.j256.ormlite.stmt.Where;
|
|||
import com.j256.ormlite.support.ConnectionSource;
|
||||
import com.j256.ormlite.support.DatabaseConnection;
|
||||
import com.j256.ormlite.table.TableUtils;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SetType;
|
||||
import mage.constants.SuperType;
|
||||
|
@ -107,40 +106,6 @@ public enum CardRepository {
|
|||
}
|
||||
}
|
||||
|
||||
public boolean cardExists(String className) {
|
||||
try {
|
||||
if (classNames == null) {
|
||||
QueryBuilder<CardInfo, Object> qb = cardDao.queryBuilder();
|
||||
qb.distinct().selectColumns("className").where().isNotNull("className");
|
||||
List<CardInfo> results = cardDao.query(qb.prepare());
|
||||
classNames = new TreeSet<>();
|
||||
for (CardInfo card : results) {
|
||||
classNames.add(card.getClassName());
|
||||
}
|
||||
}
|
||||
return classNames.contains(className);
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean cardExists(CardSetInfo className) {
|
||||
try {
|
||||
if (classNames == null) {
|
||||
QueryBuilder<CardInfo, Object> qb = cardDao.queryBuilder();
|
||||
qb.distinct().selectColumns("className").where().isNotNull("className");
|
||||
List<CardInfo> results = cardDao.query(qb.prepare());
|
||||
classNames = new TreeSet<>();
|
||||
for (CardInfo card : results) {
|
||||
classNames.add(card.getClassName());
|
||||
}
|
||||
}
|
||||
return classNames.contains(className.getName());
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private void addNewNames(CardInfo card, Set<String> namesList) {
|
||||
// require before call: qb.distinct().selectColumns("name", "modalDoubleFacesSecondSideName"...);
|
||||
|
||||
|
|
Loading…
Reference in a new issue