- Match Simulator can more easily access subfolders

This commit is contained in:
Sol
2016-04-14 02:45:50 +00:00
parent aed7a5712b
commit 73787fb126

View File

@@ -3,6 +3,7 @@ package forge.view;
import java.io.File;
import java.util.*;
import forge.properties.ForgeConstants;
import forge.util.storage.IStorage;
import org.apache.commons.lang3.text.WordUtils;
import org.apache.commons.lang3.time.StopWatch;
@@ -176,8 +177,11 @@ public class SimulateMatch {
private static Deck deckFromCommandLineParameter(String deckname, GameType type) {
int dotpos = deckname.lastIndexOf('.');
if(dotpos > 0 && dotpos == deckname.length()-4)
return DeckSerializer.fromFile(new File(deckname));
if(dotpos > 0 && dotpos == deckname.length()-4) {
String baseDir = type.equals(GameType.Commander) ?
ForgeConstants.DECK_COMMANDER_DIR : ForgeConstants.DECK_CONSTRUCTED_DIR;
return DeckSerializer.fromFile(new File(baseDir+deckname));
}
IStorage<Deck> deckStore = null;