diff --git a/base/src/main/java/de/staropensource/sosengine/base/Engine.java b/base/src/main/java/de/staropensource/sosengine/base/Engine.java index af26ff5..8ebb35e 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/Engine.java +++ b/base/src/main/java/de/staropensource/sosengine/base/Engine.java @@ -19,10 +19,12 @@ package de.staropensource.sosengine.base; +import de.staropensource.sosengine.base.annotations.EngineSubsystem; import de.staropensource.sosengine.base.classes.SubsystemMainClass; import de.staropensource.sosengine.base.classes.helpers.EventHelper; import de.staropensource.sosengine.base.classes.logging.LogIssuer; import de.staropensource.sosengine.base.data.info.EngineInformation; +import de.staropensource.sosengine.base.data.versioning.StarOpenSourceVersioningSystem; import de.staropensource.sosengine.base.events.EngineCrashEvent; import de.staropensource.sosengine.base.events.EngineShutdownEvent; import de.staropensource.sosengine.base.events.LogEvent; @@ -49,6 +51,7 @@ import java.util.Map; * @since 1-alpha0 */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) +@EngineSubsystem public final class Engine implements SubsystemMainClass { /** * Instance. @@ -74,6 +77,20 @@ public final class Engine implements SubsystemMainClass { @NotNull private LoggerInstance logger; + /** + * Contains a list of all registered subsystems. + * + * @since 1-alpha1 + * + * -- GETTER -- + * Returns a list of all registered subsystems. + * + * @since 1-alpha1 + */ + @NotNull + @Getter + private ImmutableMap<@NotNull Class, @NotNull DependencyVector> subsystems = new ImmutableMap<>(); + /** * Indicates if the engine is shutting down. * diff --git a/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemMainClass.java b/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemMainClass.java index b658b48..ba0272e 100644 --- a/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemMainClass.java +++ b/base/src/main/java/de/staropensource/sosengine/base/classes/SubsystemMainClass.java @@ -23,6 +23,7 @@ import de.staropensource.sosengine.base.Engine; import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; +import de.staropensource.sosengine.base.types.DependencyVector; /** * The interface for engine subsystem main classes. @@ -39,6 +40,14 @@ public interface SubsystemMainClass { */ LoggerInstance logger = null; + /** + * Returns the {@link DependencyVector} for this subsystem. + * + * @see DependencyVector + * @since 1-alpha1 + */ + DependencyVector getDependencyVector(); + /** * Called when the engine shuts down. * diff --git a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java index 205a6b8..e0d1c20 100644 --- a/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java +++ b/graphics/opengl/src/main/java/de/staropensource/sosengine/graphics/opengl/OpenGlSubsystem.java @@ -19,12 +19,16 @@ package de.staropensource.sosengine.graphics.opengl; +import de.staropensource.sosengine.base.annotations.EngineSubsystem; import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.helpers.EventHelper; import de.staropensource.sosengine.base.classes.logging.LogIssuer; +import de.staropensource.sosengine.base.data.info.EngineInformation; +import de.staropensource.sosengine.base.data.versioning.StarOpenSourceVersioningSystem; import de.staropensource.sosengine.base.logging.LoggerInstance; import de.staropensource.sosengine.base.types.CodePart; +import de.staropensource.sosengine.base.types.DependencyVector; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.GraphicsSubsystem; import de.staropensource.sosengine.graphics.classes.ApiMainClass; @@ -43,6 +47,7 @@ import static org.lwjgl.glfw.GLFW.*; * @since 1-alpha0 */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) +@EngineSubsystem public final class OpenGlSubsystem implements ApiMainClass { /** * Instance. @@ -187,4 +192,10 @@ public final class OpenGlSubsystem implements ApiMainClass { logger.info("Shut down in " + shutdownTime + "ms"); } + + /** {@inheritDoc} */ + @Override + public DependencyVector getDependencyVector() { + return new DependencyVector("opengl", StarOpenSourceVersioningSystem.class, EngineInformation.getInstance().getVersioningString()); + } } diff --git a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java index 0784efa..0dc1f2f 100644 --- a/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java +++ b/graphics/src/main/java/de/staropensource/sosengine/graphics/GraphicsSubsystem.java @@ -19,14 +19,18 @@ package de.staropensource.sosengine.graphics; +import de.staropensource.sosengine.base.annotations.EngineSubsystem; import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.classes.SubsystemMainClass; import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.helpers.EventHelper; import de.staropensource.sosengine.base.classes.logging.LogIssuer; +import de.staropensource.sosengine.base.data.info.EngineInformation; +import de.staropensource.sosengine.base.data.versioning.StarOpenSourceVersioningSystem; import de.staropensource.sosengine.base.events.internal.InternalEngineShutdownEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; import de.staropensource.sosengine.base.types.CodePart; +import de.staropensource.sosengine.base.types.DependencyVector; import de.staropensource.sosengine.base.utility.ListFormatter; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.classes.ApiMainClass; @@ -46,6 +50,7 @@ import java.util.Map; * @since 1-alpha0 */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) +@EngineSubsystem public final class GraphicsSubsystem implements SubsystemMainClass { /** * Instance. @@ -140,6 +145,12 @@ public final class GraphicsSubsystem implements SubsystemMainClass { EventHelper.precomputeEventListeners(GraphicsErrorEvent.class); } + /** {@inheritDoc} */ + @Override + public DependencyVector getDependencyVector() { + return new DependencyVector("graphics", StarOpenSourceVersioningSystem.class, EngineInformation.getInstance().getVersioningString()); + } + /** * Shuts the subsystem down. * diff --git a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java index 43d5657..b122363 100644 --- a/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java +++ b/graphics/vulkan/src/main/java/de/staropensource/sosengine/graphics/vulkan/VulkanSubsystem.java @@ -19,11 +19,15 @@ package de.staropensource.sosengine.graphics.vulkan; +import de.staropensource.sosengine.base.annotations.EngineSubsystem; import de.staropensource.sosengine.base.annotations.EventListener; import de.staropensource.sosengine.base.classes.events.EventPriority; import de.staropensource.sosengine.base.classes.logging.LogIssuer; +import de.staropensource.sosengine.base.data.info.EngineInformation; +import de.staropensource.sosengine.base.data.versioning.StarOpenSourceVersioningSystem; import de.staropensource.sosengine.base.logging.LoggerInstance; import de.staropensource.sosengine.base.types.CodePart; +import de.staropensource.sosengine.base.types.DependencyVector; import de.staropensource.sosengine.base.utility.Miscellaneous; import de.staropensource.sosengine.graphics.GraphicsSubsystem; import de.staropensource.sosengine.graphics.classes.ApiMainClass; @@ -40,6 +44,7 @@ import static org.lwjgl.glfw.GLFW.*; * @since 1-alpha0 */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) +@EngineSubsystem public final class VulkanSubsystem implements ApiMainClass { /** * Instance. @@ -162,4 +167,10 @@ public final class VulkanSubsystem implements ApiMainClass { logger.info("Shut down in " + shutdownTime + "ms"); } + + /** {@inheritDoc} */ + @Override + public DependencyVector getDependencyVector() { + return new DependencyVector("vulkan", StarOpenSourceVersioningSystem.class, EngineInformation.getInstance().getVersioningString()); + } } diff --git a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java index 73d172d..1722d70 100644 --- a/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java +++ b/slf4j-compat/src/main/java/de/staropensource/sosengine/slf4j_compat/Slf4jCompatibilitySubsystem.java @@ -19,11 +19,15 @@ package de.staropensource.sosengine.slf4j_compat; +import de.staropensource.sosengine.base.annotations.EngineSubsystem; import de.staropensource.sosengine.base.classes.SubsystemMainClass; import de.staropensource.sosengine.base.classes.logging.LogIssuer; +import de.staropensource.sosengine.base.data.info.EngineInformation; +import de.staropensource.sosengine.base.data.versioning.StarOpenSourceVersioningSystem; import de.staropensource.sosengine.base.events.LogEvent; import de.staropensource.sosengine.base.logging.LoggerInstance; import de.staropensource.sosengine.base.types.CodePart; +import de.staropensource.sosengine.base.types.DependencyVector; import lombok.Getter; import org.slf4j.LoggerFactory; @@ -34,6 +38,7 @@ import org.slf4j.LoggerFactory; * @since 1-alpha0 */ @SuppressWarnings({ "unused", "JavadocDeclaration", "JavadocBlankLines" }) +@EngineSubsystem public class Slf4jCompatibilitySubsystem implements SubsystemMainClass { /** * Instance. @@ -67,4 +72,10 @@ public class Slf4jCompatibilitySubsystem implements SubsystemMainClass { LoggerFactory.getLogger(CompatibilityLogger.class).debug("If you see this then the SLF4J Compatibility Subsystem is working!"); logger.info("Initialized subsystem"); } + + /** {@inheritDoc} */ + @Override + public DependencyVector getDependencyVector() { + return new DependencyVector("slf4j-compat", StarOpenSourceVersioningSystem.class, EngineInformation.getInstance().getVersioningString()); + } }