diff --git a/docs/src/progress/renderertodo.md b/docs/src/progress/renderertodo.md index 0ed7a626..d39fab00 100644 --- a/docs/src/progress/renderertodo.md +++ b/docs/src/progress/renderertodo.md @@ -1890,6 +1890,7 @@ Commenting rendering classes Convert Mesh.java to only use GL45 Material and Mesh cleanup work Texture class cleanup work +OS data wrapper diff --git a/src/main/java/electrosphere/engine/EngineState.java b/src/main/java/electrosphere/engine/EngineState.java index 57bf08be..267215a8 100644 --- a/src/main/java/electrosphere/engine/EngineState.java +++ b/src/main/java/electrosphere/engine/EngineState.java @@ -1,7 +1,9 @@ package electrosphere.engine; import java.lang.management.ManagementFactory; +import java.lang.management.RuntimeMXBean; +import electrosphere.engine.os.OSData; import electrosphere.engine.os.fs.FileWatcherService; import electrosphere.engine.service.ServiceManager; import electrosphere.engine.signal.SignalSystem; @@ -19,7 +21,12 @@ public class EngineState { /** * Java Process ID for this application */ - public String javaPID = ManagementFactory.getRuntimeMXBean().getName(); + public final RuntimeMXBean jvmData = ManagementFactory.getRuntimeMXBean(); + + /** + * The OS data + */ + public final OSData osData = new OSData(); /** * The time keeping service diff --git a/src/main/java/electrosphere/engine/os/OSData.java b/src/main/java/electrosphere/engine/os/OSData.java new file mode 100644 index 00000000..79cb25ca --- /dev/null +++ b/src/main/java/electrosphere/engine/os/OSData.java @@ -0,0 +1,77 @@ +package electrosphere.engine.os; + +/** + * Information about the operating system + */ +public class OSData { + + /** + * A type of operating system + */ + public static enum OSType { + /** + * Windows + */ + WINDOWS, + /** + * Linux + */ + LINUX, + } + + /** + * The name of the operating system + */ + String osString; + + /** + * The type of the operating system + */ + OSType osType; + + /** + * Gets the OS string + * @return The OS string + */ + public String getOsString() { + return osString; + } + + /** + * Sets the OS string + * @param osString The OS string + */ + public void setOsString(String osString) { + this.osString = osString; + } + + /** + * Gets the operating system type + * @return The operating system type + */ + public OSType getOSType() { + return osType; + } + + /** + * Sets the operating system type + * @param osType The operating system type + */ + public void setOSType(OSType osType) { + this.osType = osType; + } + + /** + * Constructor + */ + public OSData(){ + this.osString = System.getProperty("os.name"); + if(this.osString.startsWith("Windows")){ + this.osType = OSType.WINDOWS; + } else { + this.osType = OSType.LINUX; + } + } + + +}