refactor: rename and extract inline comment to method description.

master
Lodici 2014-03-13 14:11:20 +00:00
parent e87cd207cb
commit 4d9213dcc3
2 changed files with 7 additions and 4 deletions

View File

@ -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);

View File

@ -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);