Page 1 of 1

Deck API changes (r19562)

PostPosted: 12 Feb 2013, 22:22
by Max mtg
I was wrong trying to push every possible section of a deck under sideboard header.

This release offers an updated API for decks.
Code: Select all
deck.get(DeckSection.NAME) returns cardpool or null;
deck.has(DeckSection.NAME) checks if section is present and not empty
deck.getOrCreate(DeckSection.NAME) returns matching cardpool or creates a new one, if it was not present, returns the cardpool

cardpools for MAIN are pre-created, the rest should be created by code using that special deck


Bugs? Suggestions?

Re: Deck API changes (r19562)

PostPosted: 13 Feb 2013, 00:53
by myk
getting a NPE on program load (the quest decks page was the last open page):
| Open
Code: Select all
java.lang.NullPointerException
   at forge.deck.Deck.getMain(Deck.java:100)
   at forge.gui.toolbox.DeckLister.setDecks(DeckLister.java:154)
   at forge.gui.home.quest.CSubmenuQuestDecks.update(CSubmenuQuestDecks.java:67)
   at forge.gui.home.CHomeUI.itemClick(CHomeUI.java:37)
   at forge.gui.home.CHomeUI.selectPrevious(CHomeUI.java:105)
   at forge.gui.home.CHomeUI.initialize(CHomeUI.java:61)
   at forge.control.FControl.changeState(FControl.java:210)
   at forge.view.FView.initialize(FView.java:110)
   at forge.control.FControl$6.run(FControl.java:184)
   at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
   at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:702)
   at java.awt.EventQueue.access$400(EventQueue.java:82)
   at java.awt.EventQueue$2.run(EventQueue.java:663)
   at java.awt.EventQueue$2.run(EventQueue.java:661)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
   at java.awt.EventQueue.dispatchEvent(EventQueue.java:672)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
   at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
   at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
   at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
I'll attach my quest data, since that is what seems to be causing the error. (file renamed from .dat to .gz since the forum doesn't allow .dat files to be uploaded)

Re: Deck API changes (r19562)

PostPosted: 13 Feb 2013, 06:50
by Max mtg
So did I get an NPE :)

correct Quest deck serialization arrives with r19565