OS data wrapper
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
All checks were successful
studiorailgun/Renderer/pipeline/head This commit looks good
This commit is contained in:
parent
7c8bc871e1
commit
6b5408f2ca
@ -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
|
||||
|
||||
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
77
src/main/java/electrosphere/engine/os/OSData.java
Normal file
77
src/main/java/electrosphere/engine/os/OSData.java
Normal file
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user