refactor: rename and extract inline comment to method description.
parent
e87cd207cb
commit
4d9213dcc3
|
@ -302,7 +302,11 @@ public class DeckUtils {
|
|||
}
|
||||
}
|
||||
|
||||
public static void loadRandomDeck(final MagicPlayerDefinition player) {
|
||||
/**
|
||||
* Load a deck randomly chosen from the "decks" directory.
|
||||
* (includes both custom & prebuilt decks).
|
||||
*/
|
||||
public static void loadRandomDeckFile(final MagicPlayerDefinition player) {
|
||||
final File deckFile=new File(getDeckFolder());
|
||||
final List<File> deckFiles=new ArrayList<File>();
|
||||
retrieveDeckFiles(deckFile,deckFiles);
|
||||
|
|
|
@ -205,8 +205,7 @@ public class MagicDuel {
|
|||
final MagicCubeDefinition cubeDefinition = CubeDefinitions.getCubeDefinition(duelConfig.getCube());
|
||||
final DefaultDeckGenerator generator = new DefaultDeckGenerator(cubeDefinition);
|
||||
if (player.getDeckProfile().isPreConstructed()) {
|
||||
// use a deck randomly chosen from the "prebuilt" directory.
|
||||
DeckUtils.loadRandomDeck(player);
|
||||
DeckUtils.loadRandomDeckFile(player);
|
||||
} else {
|
||||
player.generateDeck(generator);
|
||||
}
|
||||
|
@ -238,7 +237,7 @@ public class MagicDuel {
|
|||
|
||||
private void createRandomDeck(final MagicPlayerDefinition player) {
|
||||
if(player.getDeckGenerator() == null && player.getDeckProfile().getNrOfColors() == 0) {
|
||||
DeckUtils.loadRandomDeck(player);
|
||||
DeckUtils.loadRandomDeckFile(player);
|
||||
} else {
|
||||
final MagicCubeDefinition cubeDefinition=CubeDefinitions.getCubeDefinition(duelConfig.getCube());
|
||||
final DefaultDeckGenerator generator = new DefaultDeckGenerator(cubeDefinition);
|
||||
|
|
Loading…
Reference in New Issue