Exemplo n.º 1
0
        private void tiempoRecorrerRuta(object sender, System.Timers.ElapsedEventArgs e)
        {
            _CronoRecorrer.Stop();
            var resetTimer = false;

            var searchStatus = _algoritmo[AlgoritmoActual].MarcarRuta();


            if (searchStatus.RutaEncontrada)
            {
                ConstruirRuta(searchStatus);
            }
            else
            {
                _LaberintoNuevo.Dibujar();

                resetTimer = true;
            }

            if (resetTimer)
            {
                _CronoRecorrer.Start();
            }
        }
Exemplo n.º 2
0
        private void IniciarLaberinto()
        {
            _CronoRecorrer.Stop();

            var workingSeed = BuscarNodoFuncional();

            while (workingSeed == 0)
            {
                workingSeed = BuscarNodoFuncional();
            }

            AlgoritmoActual = -1;
            _LaberintoNuevo = new DibujarLaberinto(pbMaze, workingSeed);
            _algoritmo      = new AlgoritmoBase[] { new AEstrella(_LaberintoNuevo.Cuadrilla) };
            Text            = @"A (Estrella) ";
            _LaberintoNuevo.Dibujar();
        }