It is currently 14 Sep 2025, 20:19
   
Text Size

CardDb exception

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Re: CardDb exception

Postby Sloth » 01 Sep 2011, 20:39

Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
Yes, but only with a limited card pool.
In constructed (full card pool) it won't reset.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: CardDb exception

Postby Max mtg » 01 Sep 2011, 21:10

Sloth wrote:
Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
Yes, but only with a limited card pool.
In constructed (full card pool) it won't reset.
That's reasonable, beacuse in constructed when cardpool is unlimited, cards are not removed from the upper list, it is not updated and sorted over :)

So the difference in sort order you see is because the tableModel remembers sort order 1 level deep. Like "sort only by color, regardless of others", while originally it was sorted by color, then name... It isn't hard to make a cascade table sorter
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby Max mtg » 01 Sep 2011, 22:11

Sloth wrote:
Max mtg wrote:Sorting resets when a card is taken away from the cardpool in top table, right?
Yes, but only with a limited card pool.
In constructed (full card pool) it won't reset.
fixed at r10150
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby friarsol » 02 Sep 2011, 01:24

I'm kinda confused about the new sorting by color. The ordering is not logical and completely different than it used to be.

This is the ordering it appears to be:
Colorless
White
Blue
Black
Multi
Red
Green

Where did this order come from and why was it changed from the alphabetical order it used to be?

It also appears that my Quest file I played last night is no longer supported?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 08:53

friarsol wrote:I'm kinda confused about the new sorting by color. The ordering is not logical and completely different than it used to be.

Where did this order come from and why was it changed from the alphabetical order it used to be?

It also appears that my Quest file I played last night is no longer supported?
This comes from the order cards are numbered throughout a set, though it was not always working.
Since r10169 the order is: W U B R G multi colorless
just same as here: http://magiccards.info/cfx/en.html

Old questfile is not supported ATM. I'm trying to add support for outdated quest format
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 09:36

@10171 old quest saves are supported again (saves from 10146 till 10151 are NOT supported)
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby Sloth » 02 Sep 2011, 09:55

When I finish a quest match and chose legacy as price booster, I get this:
| Open
java.lang.NullPointerException
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:155)
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:1)
at net.slightlymagic.maxmtg.Predicate$NodeAnd.isTrue(Predicate.java:219)
at net.slightlymagic.maxmtg.Predicate.random(Predicate.java:124)
at forge.quest.data.QuestBoosterPack.generateDistinctCards(QuestBoosterPack.java:163)
at forge.quest.data.QuestBoosterPack.generateCards(QuestBoosterPack.java:185)
at forge.quest.data.QuestData.addCards(QuestData.java:346)
at forge.Gui_WinLose.giveBooster(Gui_WinLose.java:391)
at forge.Gui_WinLose.giveQuestRewards(Gui_WinLose.java:401)
at forge.Gui_WinLose.quitButton_actionPerformed(Gui_WinLose.java:350)
at forge.Gui_WinLose$3.actionPerformed(Gui_WinLose.java:145)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 10:53

Sloth wrote:When I finish a quest match and chose legacy as price booster, I get this:
| Open
java.lang.NullPointerException
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:155)
at forge.card.CardPrinted$Predicates$PredicateSets.isTrue(CardPrinted.java:1)
at net.slightlymagic.maxmtg.Predicate$NodeAnd.isTrue(Predicate.java:219)
at net.slightlymagic.maxmtg.Predicate.random(Predicate.java:124)
at forge.quest.data.QuestBoosterPack.generateDistinctCards(QuestBoosterPack.java:163)
at forge.quest.data.QuestBoosterPack.generateCards(QuestBoosterPack.java:185)
at forge.quest.data.QuestData.addCards(QuestData.java:346)
at forge.Gui_WinLose.giveBooster(Gui_WinLose.java:391)
at forge.Gui_WinLose.giveQuestRewards(Gui_WinLose.java:401)
at forge.Gui_WinLose.quitButton_actionPerformed(Gui_WinLose.java:350)
at forge.Gui_WinLose$3.actionPerformed(Gui_WinLose.java:145)
@10173 no longer happens
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby friarsol » 02 Sep 2011, 13:37

Wow. The Deck Editor undoing the sorting on card movement is a terrible UI experience. Here's my situation:

Started a new quest and want to sell off most of my collection except for my built deck (something I do everytime I start a new quest).

Sort by color, so I can find cards that I know aren't in my deck faster:
Click on top card.
Click sell.
Card sells, but my list "unsorts" while I was just on White cards selling, now a Black card that I know is in my Deck is first on the list and highlighted. It's not apparent that the card I just tried to sell was sold (since the cards near it have been shuffled).

Next I have to click Color twice (because the editor itself thinks its sorted) to get the sort back to how I want. But the next card I sell does the same thing.

If I leave the deck in the "unsorted" state I can sell just fine, but then I need to actually read each card to remember if it was in my deck or not.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 13:55

got it, will fix in another patch today

The deckeditor evolution is not over yet. I'm actually organizing tables with cards as separate components.
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby friarsol » 02 Sep 2011, 15:54

Great thanks for patching. Another thing I noticed in quest mode is that the "sort by new" feature has been removed. So even though I did just see all the cool cards I just won, i now have to remember what i wanted to add to my deck.

Maybe instead of overwriting the Rarity, we can add a "acquired" field for Quests decks, and be able to sort by when cards were acquired?
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 18:00

friarsol wrote:Great thanks for patching. Another thing I noticed in quest mode is that the "sort by new" feature has been removed. So even though I did just see all the cool cards I just won, i now have to remember what i wanted to add to my deck.

Maybe instead of overwriting the Rarity, we can add a "acquired" field for Quests decks, and be able to sort by when cards were acquired?
See revision 10181+ for fixes with sorting

Yes, the column marking 'new' was removed. This is a temporary means as well.
Now, when deckeditors' code became much cleaner, I can add this data to upper table as a separate column

BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby friarsol » 02 Sep 2011, 18:46

Max mtg wrote:BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
That's handy. I think there is an Issue open regarding this where I suggested it might be easier to be able to sell from the Deck Editor. But if the ultimate goal is to clean those up, having the cardshop report deck appearances would be almost as good.

http://cardforge.org/bugz/view.php?id=102
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 18:59

friarsol wrote:
Max mtg wrote:BTW, would you like me to add a column in cardshop, that marks how may decks use the given card in the 'owned list'?
That's handy. I think there is an Issue open regarding this where I suggested it might be easier to be able to sell from the Deck Editor. But if the ultimate goal is to clean those up, having the cardshop report deck appearances would be almost as good.

http://cardforge.org/bugz/view.php?id=102
Thanks for this issue reference.
Yes, you can just sort by #decks and sell all that cards that would have 0 or blank value there;
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

Re: CardDb exception

Postby Max mtg » 02 Sep 2011, 22:54

10182 - added a column with number of decks.
May I close issue 102 with that?
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times

PreviousNext

Return to Developer's Corner

Who is online

Users browsing this forum: Bing [Bot] and 54 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 55 users online :: 1 registered, 0 hidden and 54 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: Bing [Bot] and 54 guests

Login Form