- Temporary fix so QuestController is instantiated when it's first requested, instead of when FModel is, since that's too early

This commit is contained in:
Sol
2012-10-08 23:27:45 +00:00
parent 7edd2c4948
commit 9c174b3e3e

View File

@@ -85,7 +85,7 @@ public enum FModel {
private final FMatchState matchState; private final FMatchState matchState;
private GauntletData gauntletData; private GauntletData gauntletData;
private final QuestController quest; private QuestController quest = null;
private final EditionCollection editions; private final EditionCollection editions;
private final FormatCollection formats; private final FormatCollection formats;
@@ -147,7 +147,6 @@ public enum FModel {
this.blocks = new StorageView<CardBlock>(new CardBlock.Reader("res/blockdata/blocks.txt", editions)); this.blocks = new StorageView<CardBlock>(new CardBlock.Reader("res/blockdata/blocks.txt", editions));
this.fantasyBlocks = new StorageView<CardBlock>(new CardBlock.Reader("res/blockdata/fantasyblocks.txt", editions)); this.fantasyBlocks = new StorageView<CardBlock>(new CardBlock.Reader("res/blockdata/fantasyblocks.txt", editions));
this.quest = new QuestController();
// TODO - there's got to be a better place for this...oblivion? // TODO - there's got to be a better place for this...oblivion?
Preferences.DEV_MODE = this.preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED); Preferences.DEV_MODE = this.preferences.getPrefBoolean(FPref.DEV_MODE_ENABLED);
@@ -164,6 +163,9 @@ public enum FModel {
} }
public final QuestController getQuest() { public final QuestController getQuest() {
if (quest == null) {
this.quest = new QuestController();
}
return quest; return quest;
} }