mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
Renamed method in CardRepository
This commit is contained in:
parent
6faca63354
commit
8d83251428
2 changed files with 3 additions and 3 deletions
|
@ -169,7 +169,7 @@ public class DeckEditorPanel extends javax.swing.JPanel {
|
||||||
public void event(Event event) {
|
public void event(Event event) {
|
||||||
if (event.getEventName().equals("double-click")) {
|
if (event.getEventName().equals("double-click")) {
|
||||||
SimpleCardView cardView = (SimpleCardView) event.getSource();
|
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;
|
Card card = cardInfo != null ? cardInfo.getCard() : null;
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
deck.getCards().add(card);
|
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) {
|
} else if (event.getEventName().equals("shift-double-click") && mode == DeckEditorMode.Constructed) {
|
||||||
SimpleCardView cardView = (SimpleCardView) event.getSource();
|
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;
|
Card card = cardInfo != null ? cardInfo.getCard() : null;
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
deck.getSideboard().add(Sets.createCard(card.getClass()));
|
deck.getSideboard().add(Sets.createCard(card.getClass()));
|
||||||
|
|
|
@ -113,7 +113,7 @@ public enum CardRepository {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CardInfo getCard(String setCode, int cardNumber) {
|
public CardInfo findCard(String setCode, int cardNumber) {
|
||||||
try {
|
try {
|
||||||
QueryBuilder<CardInfo, Object> queryBuilder = cardDao.queryBuilder();
|
QueryBuilder<CardInfo, Object> queryBuilder = cardDao.queryBuilder();
|
||||||
queryBuilder.where().eq("setCode", setCode).and().eq("cardNumber", cardNumber);
|
queryBuilder.where().eq("setCode", setCode).and().eq("cardNumber", cardNumber);
|
||||||
|
|
Loading…
Reference in a new issue