From 8b8a346775385b06ffb195f84a2c26b9d0adbbba Mon Sep 17 00:00:00 2001 From: Robert Vokac Date: Fri, 16 Aug 2024 17:01:22 +0200 Subject: [PATCH] Refactoring VII --- .../java/com/openeggbert/lwjgl3/DesktopUtils.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lwjgl3/src/main/java/com/openeggbert/lwjgl3/DesktopUtils.java b/lwjgl3/src/main/java/com/openeggbert/lwjgl3/DesktopUtils.java index bd4a10d..514ce8e 100644 --- a/lwjgl3/src/main/java/com/openeggbert/lwjgl3/DesktopUtils.java +++ b/lwjgl3/src/main/java/com/openeggbert/lwjgl3/DesktopUtils.java @@ -19,6 +19,7 @@ /////////////////////////////////////////////////////////////////////////////////////////////// package com.openeggbert.lwjgl3; +import com.openeggbert.core.gamespace.GameDirectoryType; import com.openeggbert.core.release.Release; import com.openeggbert.core.gamespace.GameSpace; import com.openeggbert.core.main.OpenEggbertException; @@ -156,8 +157,8 @@ public class DesktopUtils { } public static Release findFeatureLevelFromDirectory(File dir) { - final File image24Directory = new File(dir, "IMAGE24"); - final File image24x2Directory = new File(dir, "IMAGE24X2"); + final File image24Directory = new File(dir, GameDirectoryType.IMAGE24.name()); + final File image24x2Directory = new File(dir, GameDirectoryType.IMAGE24X2.name()); if (image24Directory.exists() && image24x2Directory.exists()) { return Release.OPEN_EGGBERT_3; } @@ -165,9 +166,9 @@ public class DesktopUtils { return Release.SPEEDY_BLUPI_DEMO; } if (!new File(dir, "DATA").exists()) { - throw new OpenEggbertException("Directory does not exist: " + new File(dir, "DATA").getAbsolutePath()); + throw new OpenEggbertException("Directory does not exist: " + new File(dir, GameDirectoryType.DATA.name()).getAbsolutePath()); } - final File image08Directory = new File(dir, "IMAGE08"); + final File image08Directory = new File(dir, GameDirectoryType.IMAGE08.name()); if (image08Directory.exists()) { if (new File(image08Directory, "INSERT.BLP").exists()) { //blupi @@ -178,7 +179,7 @@ public class DesktopUtils { } } else { //eggbert - final File image16Directory = new File(dir, "IMAGE16"); + final File image16Directory = new File(dir, GameDirectoryType.IMAGE16.name()); if (!image16Directory.exists()) { return Release.SPEEDY_EGGBERT_DEMO; }