示例#1
0
 protected static String[] getWindowsCommand(Integer roundsNumber, String initialPosition) {
   String[] cmd = new String[12];
   cmd[0] = "cmd.exe";
   cmd[1] = "/C";
   cmd[2] = "java";
   cmd[3] = "-cp";
   try {
     cmd[4] =
         Settings.getPathTo("lib")
             + File.separator
             + "rita.jar;"
             + Settings.getPathTo("lib")
             + File.separator
             + "robocode.jar;"
             + Settings.getPathTo("lib")
             + File.separator
             + "robocode.ui-1.7.3.6.jar";
   } catch (FileNotFoundException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
   cmd[5] = "-Xmx512M";
   cmd[6] = "rita.battle.Batalla";
   cmd[7] = Settings.getInstallPath(); // 1er argumento
   cmd[8] =
       HelperEditor.currentRobotPackage + "." + HelperEditor.currentRobotName; // 2do argumento
   cmd[9] = BatallaConfig.chooseEnemy(Settings.getProperty("level.default")); // 3er argumento
   cmd[10] =
       roundsNumber != null
           ? roundsNumber.toString()
           : Integer.toString(Batalla.NUMBER_OF_ROUNDS); // 4to argumento Número de rondas
   cmd[11] = initialPosition;
   return cmd;
 }
示例#2
0
 protected static String[] getUnixCommand(Integer roundsNumber, String initialPosition) {
   String[] cmd = new String[10];
   cmd[0] = "java";
   cmd[1] = "-cp";
   cmd[2] =
       Settings.getInstallPath()
           + "lib/rita.jar:"
           + Settings.getInstallPath()
           + "lib/robocode.jar:"
           + Settings.getInstallPath()
           + "lib/robocode.ui-1.7.3.5.jar";
   cmd[3] = "-Xmx512M";
   cmd[4] = "rita.battle.Batalla";
   cmd[5] = Settings.getInstallPath(); // 1er argumento
   cmd[6] =
       HelperEditor.currentRobotPackage + "." + HelperEditor.currentRobotName; // 2do argumento
   cmd[7] = BatallaConfig.chooseEnemy(Settings.getProperty("level.default")); // 3er argumento
   cmd[8] =
       roundsNumber != null
           ? roundsNumber.toString()
           : Integer.toString(Batalla.NUMBER_OF_ROUNDS); // 4to argumento Número de rondas
   cmd[9] = initialPosition;
   return cmd;
 }