Renamed method in CardRepository

This commit is contained in:
North 2012-10-21 18:23:27 +03:00
parent 6faca63354
commit 8d83251428
2 changed files with 3 additions and 3 deletions

View file

@ -169,7 +169,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
public void event(Event event) {
if (event.getEventName().equals("double-click")) {
SimpleCardView cardView = (SimpleCardView) event.getSource();
CardInfo cardInfo = CardRepository.instance.getCard(cardView.getExpansionSetCode(), cardView.getCardNumber());
CardInfo cardInfo = CardRepository.instance.findCard(cardView.getExpansionSetCode(), cardView.getCardNumber());
Card card = cardInfo != null ? cardInfo.getCard() : null;
if (card != null) {
deck.getCards().add(card);
@ -187,7 +187,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
} else if (event.getEventName().equals("shift-double-click") && mode == DeckEditorMode.Constructed) {
SimpleCardView cardView = (SimpleCardView) event.getSource();
CardInfo cardInfo = CardRepository.instance.getCard(cardView.getExpansionSetCode(), cardView.getCardNumber());
CardInfo cardInfo = CardRepository.instance.findCard(cardView.getExpansionSetCode(), cardView.getCardNumber());
Card card = cardInfo != null ? cardInfo.getCard() : null;
if (card != null) {
deck.getSideboard().add(Sets.createCard(card.getClass()));

View file

@ -113,7 +113,7 @@ public enum CardRepository {
}
}
public CardInfo getCard(String setCode, int cardNumber) {
public CardInfo findCard(String setCode, int cardNumber) {
try {
QueryBuilder<CardInfo, Object> queryBuilder = cardDao.queryBuilder();
queryBuilder.where().eq("setCode", setCode).and().eq("cardNumber", cardNumber);