private static List <object[]> GetArrayOfMazeAlgos()
        {
            var list = new List <object[]>();

            var mazes = KnownMazesTypes.GetAllMazeAlgos().ToArray <object>();

            var dimensonList = new List <(int, int)>()
            {
                (10, 10), // even, even
                (11, 11), // odd, odd
                (50, 80), // even, even(bigger)
                (80, 50), // even(bigger), even
                (17, 10), // odd(bigger), even
                (10, 17), // even, odd(bigger)
            };

            foreach (IMazeGenAlgorithm algorithm in mazes)
            {
                foreach ((int, int)d in dimensonList)
                {
                    list.Add(new object[] { algorithm, d });
                }
            }

            return(list);
        }
Example #2
0
            public void CreateDemoImageAndGifs(IConfigurationRoot configRoot)
            {
                if (configRoot["CreateDemoImages"] != null)
                {
                    bool run = configRoot["InfiniteDemo"] != null ? true : false;

                    while (run)
                    {
                        var list  = KnownMazesTypes.GetAllMazeAlgos();
                        var tasks = new List <Task>();
                        foreach (IMazeGenAlgorithm i in list)
                        {
                            tasks.Add(CreateImageAndGifForAlgoAsync(i));
                        }
                        Task.WaitAll(tasks.ToArray());

                        Console.WriteLine("Tap key for another batch.");
                        Console.ReadKey();
                    }
                }
            }