Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/18/13 10:24:33 (9 years ago)
Author:
jkarder
Message:

#2069:

  • fixed deserialization of the RobocodeProblem
  • added a BattleRunnerDialog that allows to configure some arguments of the battle runner
  • added functionality to save a Solution in a java file
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionCodeView.cs

    r9947 r9985  
    2121
    2222using System;
     23using System.IO;
     24using System.Windows.Forms;
    2325using HeuristicLab.Core.Views;
    2426using HeuristicLab.MainForm;
     27using HeuristicLab.Problems.Robocode.Views;
    2528
    2629namespace HeuristicLab.Problems.Robocode {
     
    4952    }
    5053
     54    private void btnSave_Click(object sender, EventArgs e) {
     55      saveFileDialog.FileName = programName;
     56      var result = saveFileDialog.ShowDialog(this);
     57      if (result == DialogResult.OK)
     58        File.WriteAllText(saveFileDialog.FileName, programCode.Text);
     59    }
     60
    5161    private void btnRunInRobocode_Click(object sender, EventArgs e) {
    52       Interpreter.EvaluateTankProgram(Content.Tree, Content.Path, Content.Enemies, programName, true, Content.NrOfRounds);
     62      using (var battleRunnerDlg = new BattleRunnerDialog(Content)) {
     63        var result = battleRunnerDlg.ShowDialog(this);
     64        if (result == DialogResult.OK) {
     65          var enemies = battleRunnerDlg.Enemies;
     66          string path = enemies.RobocodePath;
     67          int nrOfRounds = battleRunnerDlg.NrOfRounds;
     68          Interpreter.EvaluateTankProgram(Content.Tree, path, enemies, programName, true, nrOfRounds);
     69        }
     70      }
    5371    }
    5472  }
Note: See TracChangeset for help on using the changeset viewer.