Example #1
0
        private Menu createAlphaMenu()
        {
            List <IGameControl> alpha_controls = parser.getAllControls().OrderBy(c => c.Title).ToList();
            SubMenu             sub            = new SubMenu(logger, String.Empty, alpha_controls);
            List <IGameControl> wanted         = parser.getWantedControls((int)MenuType.ALPHA);

            return(new Menu(MenuType.ALPHA, new List <SubMenu>()
            {
                sub
            }, wanted, logger));
        }
Example #2
0
        private Menu createRandomMenu()
        {
            List <IGameControl> randomized_controls = parser.getAllControls();
            Random random = new Random();
            int    index  = randomized_controls.Count - 1;

            while (index > 0)
            {
                int          next = random.Next(index + 1);
                IGameControl temp = randomized_controls[next];
                randomized_controls[next]  = randomized_controls[index];
                randomized_controls[index] = temp;
                index--;
            }

            SubMenu             sub    = new SubMenu(logger, String.Empty, randomized_controls);
            List <IGameControl> wanted = parser.getWantedControls((int)MenuType.RANDOM);

            return(new Menu(MenuType.RANDOM, new List <SubMenu>()
            {
                sub
            }, wanted, logger));
        }