private void bStartClick(object sender, EventArgs e) { bStart.Enabled = false; bPause.Enabled = true; bPause.Visible = true; isFinished = false; RunHeuristics(listBox1.Items.Count == 0); if (!isFinished) { if (View.Board.IsSolved()) { MessageBox.Show("Solved!"); LogHeuristic("Solved!\n"); isFinished = true; View.Refresh(); } else { MessageBox.Show("Can not further be solved using these heuristics..."); LogHeuristic("\nCan not further be solved using these heuristics..."); if (MessageBox.Show("Save state?", "Verify", MessageBoxButtons.YesNo) == DialogResult.Yes) { TekBoardParser parser = new TekBoardParser(); parser.Export(View.Board, "test.tx"); } isFinished = true; } } bStart.Enabled = true; }
public bool SaveToFile(string FileName) { if (_view.Board == null) { return(false); } TekBoardParser tbp = new TekBoardParser(); tbp.Export(_view.Board, FileName); return(true); }