Renderer/src/test/java/testutils/EngineInit.java
austin d0e5f3b7d2
Some checks failed
studiorailgun/Renderer/pipeline/head There was a failure building this commit
more testing work
2024-08-22 19:56:53 -04:00

35 lines
1.1 KiB
Java

package testutils;
import java.util.concurrent.TimeUnit;
import electrosphere.engine.Globals;
import electrosphere.engine.loadingthreads.LoadingThread;
import electrosphere.engine.loadingthreads.LoadingThread.LoadingThreadType;
import electrosphere.menu.WindowStrings;
import electrosphere.renderer.ui.elements.Window;
public class EngineInit {
/**
* Setups up a locally-connected client and server that have loaded a test scene
*/
public static void setupConnectedTestScene(){
//
//load the scene
LoadingThread loadingThread = new LoadingThread(LoadingThreadType.LEVEL,"testscene1");
loadingThread.start();
//
//wait for client to be fully init'd
while(((Window)Globals.elementManager.getWindow(WindowStrings.WINDOW_LOADING)).getVisible() || Globals.playerEntity == null){
TestEngineUtils.simulateFrames(1);
try {
TimeUnit.MILLISECONDS.sleep(1);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}