moved deckmanager from AllZone to FModel, had to set lazy initialization due to CardDb late initialization.

set even better filter on draft and sealed folders
This commit is contained in:
Maxmtg
2012-02-22 04:58:15 +00:00
parent e905c8abbf
commit 1c44a2c204
16 changed files with 67 additions and 83 deletions

View File

@@ -35,6 +35,7 @@ import forge.ConstantStringArrayList;
import forge.GameAction;
import forge.Singletons;
import forge.control.input.InputControl;
import forge.deck.CardCollections;
import forge.game.GameState;
import forge.game.GameSummary;
import forge.properties.ForgePreferences;
@@ -74,6 +75,9 @@ public enum FModel {
private final QuestEventManager questEventManager;
private final GameState gameState;
private final FMatchState matchState;
// have to implement lazy initialization - at the moment of FModel.ctor() CardDb is not ready yet.
private CardCollections decks;
/**
* Constructor.
@@ -305,6 +309,16 @@ public enum FModel {
return this.questEventManager;
}
/**
* Returns all player's decks for constructed, sealed and whatever
* @return {@link forge.decks.CardCollections}
*/
public final CardCollections getDecks() {
if (decks == null)
this.decks = new CardCollections(ForgeProps.getFile(NewConstants.NEW_DECKS));
return decks;
}
/**
* Gets the game action model.
*