示例#1
0
        static void Main()
        {
            LoadPlugins();
            _run = new SolveRun(_configurationGenerator, _solver, _display, _celebrator, Settings.Default.CubeSize);


            Console.WriteLine("Initialising display adaptor: {0}", _display.PluginName);
            _display.Closed += OnDisplayClosed;
            _display.Initialise().Wait();


            while (_running)
            {
                _run.Run().Wait();
            }

            Console.ReadLine();
        }
        public async Task StartAnimation()
        {
            var configurationGenerator = new RandomCubeConfigurationGenerator();
            ISolver solver3x3x3 = new BeginerMethod();
            ISolver solver5x5x5 = new SimpleSolver();

            var celebrator = new TimeDelayCelebrator(2000);

            // TODO: LOAD ALL SOLVERS + GENERATORS, GENERATE A CONFIG WITH RANDOM SIZE, PICK A SOLVER BASED ON THE CONFIGURATION GIVEN

            
            var random = new Random();

            while (true)
            {
                var cubeSize = GetCubeSize(random);

                ISolver solver = cubeSize == 3 ? solver3x3x3 : solver5x5x5;

                var run = new SolveRun(configurationGenerator, solver, DisplayControl, celebrator, cubeSize);
                await run.Run().ConfigureAwait(true);
            }
            // ReSharper disable once FunctionNeverReturns
        }