public NewBattleDialog(RobocodeManager manager, BattleProperties battleProperties) {
    super(manager.getWindowManager().getRobocodeFrame(), true);
    this.manager = manager;
    this.battleProperties = battleProperties;

    initialize();
  }
Beispiel #2
0
  public JPanel initialize(String selected_robots) {
    try {
      manager = new RobocodeManager(false, null);

      Thread.currentThread().setName("Application Thread");

      BattleProperties battleProperties = manager.getBattleManager().getBattleProperties();
      // battleProperties.setSelectedRobots("test.mtest12,test.mtest14");
      battleProperties.setSelectedRobots(selected_robots);
      manager.getBattleManager().startNewBattle(battleProperties, true, false);
      manager.getBattleManager().getBattle().setDesiredTPS(20);

      JPanel panel = manager.getWindowManager().getRobocodeFrame().getRobocodeContentPane();
      panel.setBounds(100, 100, 500, 600);
      panel.setOpaque(true);
      return panel;
    } catch (Throwable e) {
      Logger.log(e);
      return null;
    }
  }