Changeset 9985 for branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionCodeView.cs
- Timestamp:
- 09/18/13 10:24:33 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/Robocode.TrunkInt/HeuristicLab.Problems.Robocode.Views/3.3/SolutionCodeView.cs
r9947 r9985 21 21 22 22 using System; 23 using System.IO; 24 using System.Windows.Forms; 23 25 using HeuristicLab.Core.Views; 24 26 using HeuristicLab.MainForm; 27 using HeuristicLab.Problems.Robocode.Views; 25 28 26 29 namespace HeuristicLab.Problems.Robocode { … … 49 52 } 50 53 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 51 61 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 } 53 71 } 54 72 }
Note: See TracChangeset
for help on using the changeset viewer.