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(); } } } }