It is currently 07 Sep 2025, 23:49
   
Text Size

Deck API changes (r19562)

Post MTG Forge Related Programming Questions Here

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

Deck API changes (r19562)

Postby Max mtg » 12 Feb 2013, 22:22

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?
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: Deck API changes (r19562)

Postby myk » 13 Feb 2013, 00:53

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)
Attachments
PixieLinh.gz
(92.21 KiB) Downloaded 183 times
myk
 
Posts: 439
Joined: 17 Jan 2013, 02:39
Location: California
Has thanked: 38 times
Been thanked: 57 times

Re: Deck API changes (r19562)

Postby Max mtg » 13 Feb 2013, 06:50

So did I get an NPE :)

correct Quest deck serialization arrives with r19565
Single class for single responsibility.
Max mtg
Programmer
 
Posts: 1997
Joined: 02 Jul 2011, 14:26
Has thanked: 173 times
Been thanked: 334 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 43 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 43 users online :: 0 registered, 0 hidden and 43 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 43 guests

Login Form