Enable setting the visual via argument
This commit is contained in:
@@ -2,6 +2,8 @@ package de.siphalor.was;
|
|||||||
|
|
||||||
import de.siphalor.was.content.lang.I18n;
|
import de.siphalor.was.content.lang.I18n;
|
||||||
import de.siphalor.was.util.Util;
|
import de.siphalor.was.util.Util;
|
||||||
|
import de.siphalor.was.visual.ConsoleVisual;
|
||||||
|
import de.siphalor.was.visual.JFXVisual;
|
||||||
|
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
|
||||||
@@ -9,6 +11,16 @@ public class Start {
|
|||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
WhatAStorage was = WhatAStorage.getInstance();
|
WhatAStorage was = WhatAStorage.getInstance();
|
||||||
was.reload();
|
was.reload();
|
||||||
|
|
||||||
|
if (args.length > 0) {
|
||||||
|
switch (args[0]) {
|
||||||
|
case "jfx" -> was.setVisual(new JFXVisual());
|
||||||
|
case "console" -> was.setVisual(new ConsoleVisual());
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
was.setVisual(new JFXVisual());
|
||||||
|
}
|
||||||
|
|
||||||
was.setup();
|
was.setup();
|
||||||
|
|
||||||
Util.LOGGER.log(Level.INFO, I18n.getInstance().getString("test.hello-world"));
|
Util.LOGGER.log(Level.INFO, I18n.getInstance().getString("test.hello-world"));
|
||||||
|
|||||||
@@ -10,11 +10,13 @@ import de.siphalor.was.content.quest.Quest;
|
|||||||
import de.siphalor.was.content.quest.QuestGenerator;
|
import de.siphalor.was.content.quest.QuestGenerator;
|
||||||
import de.siphalor.was.content.quest.QuestManager;
|
import de.siphalor.was.content.quest.QuestManager;
|
||||||
import de.siphalor.was.content.quest.RandomQuestGenerator;
|
import de.siphalor.was.content.quest.RandomQuestGenerator;
|
||||||
import de.siphalor.was.game.*;
|
import de.siphalor.was.game.Balance;
|
||||||
|
import de.siphalor.was.game.Options;
|
||||||
|
import de.siphalor.was.game.Storage;
|
||||||
|
import de.siphalor.was.game.Transaction;
|
||||||
import de.siphalor.was.util.Pair;
|
import de.siphalor.was.util.Pair;
|
||||||
import de.siphalor.was.util.Util;
|
import de.siphalor.was.util.Util;
|
||||||
import de.siphalor.was.visual.ConsoleVisual;
|
import de.siphalor.was.visual.ConsoleVisual;
|
||||||
import de.siphalor.was.visual.JFXVisual;
|
|
||||||
import de.siphalor.was.visual.Visual;
|
import de.siphalor.was.visual.Visual;
|
||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
@@ -59,8 +61,10 @@ public class WhatAStorage {
|
|||||||
productManager = new ProductManager();
|
productManager = new ProductManager();
|
||||||
questManager = new QuestManager();
|
questManager = new QuestManager();
|
||||||
options = new Options();
|
options = new Options();
|
||||||
|
}
|
||||||
|
|
||||||
visual = new ConsoleVisual();
|
public void setVisual(Visual visual) {
|
||||||
|
this.visual = visual;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ContentManager getContentManager() {
|
public ContentManager getContentManager() {
|
||||||
@@ -103,6 +107,9 @@ public class WhatAStorage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void setup() {
|
public void setup() {
|
||||||
|
if (visual == null) {
|
||||||
|
throw new IllegalStateException("No visual set for WhatAStorage!");
|
||||||
|
}
|
||||||
visual.setup(this);
|
visual.setup(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user