Remove args from Main#run method

This commit is contained in:
JeremyStar™ 2024-08-19 02:49:14 +02:00
parent 9ff4f96814
commit f828d31094
Signed by: JeremyStarTM
GPG key ID: E366BAEF67E4704D

View file

@ -31,8 +31,6 @@ import de.staropensource.sosengine.base.utility.Miscellaneous;
import de.staropensource.sosengine.base.utility.parser.StackTraceParser; import de.staropensource.sosengine.base.utility.parser.StackTraceParser;
import de.staropensource.sosengine.graphics.GraphicsSubsystem; import de.staropensource.sosengine.graphics.GraphicsSubsystem;
import de.staropensource.sosengine.graphics.classes.Window; import de.staropensource.sosengine.graphics.classes.Window;
import de.staropensource.sosengine.graphics.classes.api.ApiClass;
import de.staropensource.sosengine.graphics.classes.api.ApiManagementClass;
import de.staropensource.sosengine.graphics.events.InputEvent; import de.staropensource.sosengine.graphics.events.InputEvent;
import de.staropensource.sosengine.graphics.types.input.Key; import de.staropensource.sosengine.graphics.types.input.Key;
import de.staropensource.sosengine.graphics.types.input.KeyState; import de.staropensource.sosengine.graphics.types.input.KeyState;
@ -102,14 +100,14 @@ public final class Main {
/** /**
* The program's entrypoint. * The program's entrypoint.
* Calls {@link #run(String[])} after invocation. * Calls {@link #run()} after invocation.
* *
* @see #run(String[]) * @see #run()
* @param args program's command line arguments * @param args program's command line arguments
* @since v1-alpha0 * @since v1-alpha0
*/ */
public static void main(String[] args) { public static void main(String[] args) {
getInstance().run(args); getInstance().run();
} }
/** /**
@ -117,11 +115,10 @@ public final class Main {
* Here's where the "real magic" happens. * Here's where the "real magic" happens.
* *
* @see #main(String[]) * @see #main(String[])
* @param args program's command line arguments
* @since v1-alpha0 * @since v1-alpha0
*/ */
@SneakyThrows @SneakyThrows
public void run(String[] args) { public void run() {
Miscellaneous.executeSafely(() -> { Miscellaneous.executeSafely(() -> {
// Initialize sos!engine // Initialize sos!engine
engine = new Engine(); engine = new Engine();
@ -187,10 +184,6 @@ public final class Main {
if (!GraphicsSubsystem.getInstance().setGraphicsApi()) if (!GraphicsSubsystem.getInstance().setGraphicsApi())
logger.crash("No Graphics API is compatible"); logger.crash("No Graphics API is compatible");
// Define 'api' & 'management' variables
ApiClass api = GraphicsSubsystem.getInstance().getApi();
ApiManagementClass management = api.getManagement();
// Create window // Create window
Window window; Window window;
try { try {
@ -235,7 +228,7 @@ public final class Main {
/** /**
* Crashes the application when a throwable * Crashes the application when a throwable
* is thrown in {@link #run(String[])}. * is thrown in {@link #run()}.
* *
* @since v1-alpha2 * @since v1-alpha2
*/ */