Error resolving one of the NewConstants
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
3 posts
• Page 1 of 1
Error resolving one of the NewConstants
by 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));
}
}
}
}
The Force will be with you, Always.
-

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
by 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.
Re: Error resolving one of the NewConstants
by 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.
-

Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests