public void SetAlgorithm(Grid.Algorithms alg) { if (grid.Algorithm != alg) { grid.Algorithm = alg; Generate(); } }
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(); }
void UpdateAlgorithmItem(ToolStripMenuItem item, Grid.Algorithms alg) { item.Checked = GetGrid().Algorithm == alg; item.Enabled = GetGrid().GetMethod(alg) != null; }
void ClickAlgorithmMenuItem(Grid.Algorithms alg) { gridControl1.SetAlgorithm(alg); UpdateAlgorithmMenus(); }
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; }