mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 03:08:02 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user