public static void cleanupForRobocodeEngine() { // here we cross transition to EngineClassLoader classes using interface which is defined in // system classLoader RobocodeMainBase main = Container.getComponent(RobocodeMainBase.class); main.cleanup(); }
public static void initContainerForRobocodeEngine(File robocodeHome, IBattleListener listener) { try { if (robocodeHome == null) { robocodeHome = FileUtil.getCwd(); } FileUtil.setCwd(robocodeHome); File robotsDir = FileUtil.getRobotsDir(); if (robotsDir == null) { throw new RuntimeException("No valid robot directory is specified"); } else if (!(robotsDir.exists() && robotsDir.isDirectory())) { throw new RuntimeException( '\'' + robotsDir.getAbsolutePath() + "' is not a valid robot directory"); } } catch (IOException e) { System.err.println(e); return; } // here we cross transition to EngineClassLoader classes using interface which is defined in // system classLoader RobocodeMainBase main = Container.getComponent(RobocodeMainBase.class); main.initForRobocodeEngine(listener); }
public static void robocodeMain(Object args) { // here we cross transition to EngineClassLoader classes using interface which is defined in // system classLoader RobocodeMainBase main = Container.getComponent(RobocodeMainBase.class); main.loadSetup((String[]) args); // Make sure ALL uncaught exceptions are logged Thread.setDefaultUncaughtExceptionHandler( new UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { Logger.logError("UncaughtException on thread " + t.getClass(), e); } }); ThreadGroup group = new ThreadGroup("Robocode thread group"); new Thread(group, main, "Robocode main thread").start(); }