示例#1
0
        public ToolBarUserControl(MazeEngine mazeEngine)
        {
            InitializeComponent();
            this.mazeEngine = mazeEngine;

            sliderValue = new SliderValue();
            DataContext = sliderValue;
        }
示例#2
0
 public Dfs(MazeDrawer mazeDrawer, BackgroundWorker backgroundWorker, SliderValue sleep, MazeSettings mazeSettings)
 {
     this.mazeDrawer       = mazeDrawer;
     this.backgroundWorker = backgroundWorker;
     this.sleep            = sleep;
     this.mazeSettings     = mazeSettings;
     SetVar();
     SetListOfUnvisitedCell(mazeDrawer);
 }
        public DfsSolver(MazeDrawer mazeDrawer, MazeSettings mazeSettings, SliderValue sleep)
        {
            this.mazeDrawer   = mazeDrawer;
            this.mazeSettings = mazeSettings;
            this.sleep        = sleep;

            DrawStartCell();
            DrawEndCell();
        }
示例#4
0
 /// <summary>
 /// Start the dfs animation called by the play button in the tool bar user control
 /// </summary>
 /// <param name="progressBar"> use to show the progress of the animation</param>
 /// <param name="sleep"> slider to get the sleeping time</param>
 internal void StartDfs(ProgressBar progressBar, SliderValue sleep)
 {
     if (backgroundWorker.IsBusy != true)
     {
         mazeDrawer.Redraw();
         this.progressBar = progressBar;
         this.sleep       = sleep;
         backgroundWorker.RunWorkerAsync();
     }
 }