Page 1 of 1

Error resolving one of the NewConstants

PostPosted: 21 Feb 2011, 04:16
by Rob Cashwalker
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.

Re: Error resolving one of the NewConstants

PostPosted: 21 Feb 2011, 04:38
by Fnoed
NEW_DECKS is defined in the forge.properties.NewConstants interface. All of the other classes that use the NewDeckIO classes implement that interface.

Re: Error resolving one of the NewConstants

PostPosted: 22 Feb 2011, 03:56
by Rob Cashwalker
I ended up just referring to it as NewConstants.NEW_DECKS, and eclipse is happy.