Example #1
0
 public void SetAlgorithm(Grid.Algorithms alg)
 {
     if (grid.Algorithm != alg)
     {
         grid.Algorithm = alg;
         Generate();
     }
 }
Example #2
0
 public void Generate(Grid grid)
 {
     Grid.Algorithms alg = Grid.Algorithms.RecursiveBacktrack;
     if (this.grid != null)
     {
         alg = this.grid.Algorithm;
     }
     this.grid      = grid;
     start          = finish = null;
     grid.Algorithm = alg;
     Generate();
 }
Example #3
0
 void UpdateAlgorithmItem(ToolStripMenuItem item, Grid.Algorithms alg)
 {
     item.Checked = GetGrid().Algorithm == alg;
     item.Enabled = GetGrid().GetMethod(alg) != null;
 }
Example #4
0
 void ClickAlgorithmMenuItem(Grid.Algorithms alg)
 {
     gridControl1.SetAlgorithm(alg);
     UpdateAlgorithmMenus();
 }
Example #5
0
 void AddAlgorithmMenuItem(ToolStripMenuItem item, Grid.Algorithms alg)
 {
     item.Click += new EventHandler((object sender, EventArgs e) => ClickAlgorithmMenuItem(alg));
     algorithmItemUpdates.Add(() => UpdateAlgorithmItem(item, alg));
 }
 public MazeAlgorithmAttribute(Grid.Algorithms alg)
 {
     this.alg = alg;
 }