forked from External/mage
spjspj - Add the option of having a .dck file as a cube
This commit is contained in:
parent
548b05ba74
commit
26d38f0773
6 changed files with 153 additions and 13 deletions
|
|
@ -67,6 +67,22 @@ public class CubeFactory {
|
|||
return draftCube;
|
||||
}
|
||||
|
||||
public DraftCube createDeckDraftCube(String draftCubeName, String chosenDckFile) {
|
||||
|
||||
DraftCube draftCube;
|
||||
Constructor<?> con;
|
||||
try {
|
||||
con = draftCubes.get(draftCubeName).getConstructor(new Class[]{String.class});
|
||||
draftCube = (DraftCube)con.newInstance(new Object[] {chosenDckFile});
|
||||
} catch (Exception ex) {
|
||||
logger.fatal("CubeFactory error", ex);
|
||||
return null;
|
||||
}
|
||||
logger.debug("Draft cube created: " + draftCube.getName());
|
||||
|
||||
return draftCube;
|
||||
}
|
||||
|
||||
public Set<String> getDraftCubes() {
|
||||
return draftCubes.keySet();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue