It is currently 29 Oct 2025, 07:05
   
Text Size

Error resolving one of the NewConstants

Post MTG Forge Related Programming Questions Here

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

Error resolving one of the NewConstants

Postby Rob Cashwalker » 21 Feb 2011, 04:16

Eclipse is complaining about not being able to resolve NEW_DECKS in the NewDeckIO constructor. I copied that line from the deck editor, and it had the same two imports I have. Can anyone help me figure out why?

Code: Select all

package forge;

import java.util.ArrayList;

import forge.properties.ForgeProps;
import forge.properties.NewConstants;

public class DraftFormat {
   private CardList CardPool;
   
   private ArrayList<String> Sets;
   
   private BoosterGenerator booster;
   
   private String Type;
   private String Name;
   
   public DraftFormat() {
      booster = new BoosterGenerator();
   }
   
   public DraftFormat(String FormatFile) {
      ArrayList<String> format = FileUtil.readFile("/res/formatdata/" + FormatFile);
      
      for (int i=0; i<=format.size(); i++) {
         String line = format.get(i);
         
         if (line.startsWith("Type:"))
            Type = line.substring(5);
         else if (line.startsWith("Name:"))
            Name = line.substring(5);
         else if (line.startsWith("Set:"))
            Sets.add(line.substring(4));
         else if (line.startsWith("DeckList:")) {
            NewDeckIO dio = new NewDeckIO(ForgeProps.getFile(NEW_DECKS));
         }
      }
   }
}
BTW, the reason for needing the decks folder: Why not use the deck editor itself to build custom draft pools? No need to write another gui.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: Error resolving one of the NewConstants

Postby Fnoed » 21 Feb 2011, 04:38

NEW_DECKS is defined in the forge.properties.NewConstants interface. All of the other classes that use the NewDeckIO classes implement that interface.
Fnoed
 
Posts: 84
Joined: 20 Dec 2010, 01:03
Has thanked: 0 time
Been thanked: 3 times

Re: Error resolving one of the NewConstants

Postby Rob Cashwalker » 22 Feb 2011, 03:56

I ended up just referring to it as NewConstants.NEW_DECKS, and eclipse is happy.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 8 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 8 users online :: 0 registered, 0 hidden and 8 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 8 guests

Login Form