public void Start()
    {
        drawerButton.onClick.AddListener(() =>
        {
            drawerAnimator.SetTrigger("Toggle");
        });
        enterButton.onClick.AddListener(() =>
        {
            animator.SetTrigger("Enter");
        });
        editConfigButton.onClick.AddListener(() =>
        {
            if (isConfigShowing)
            {
                ExitConfig();
            }
            else
            {
                EnterConfig();
            }
        });
        consoles = consolesContainer.GetComponentInChildren <ConsoleSelect>();
        games    = gamesContainer.GetComponentInChildren <GameSelect>();

        //ShowConsoles();
    }
예제 #2
0
        public void ExactlyN()
        {
            var expected = Console.NintendoConsoles.Where(c => c.PortableConsole).ToArray();
            var actual   =
                Query.SelectExactly <Console>(expected.Length, ConsoleSelect.Where("PortableConsole = 1")).ToArray();

            CollectionAssert.AreEqual(expected, actual);
        }
예제 #3
0
        private static ConsoleOption CreateSubMachine()
        {
            ConsoleSelect main = new ConsoleSelect("Sub-Machine", "Sub-Machine Menu");

            main.AddOption(new ConsoleCommand("SM - One", () => { Console.WriteLine("Command SM - One"); Console.ReadKey(); }));
            main.AddOption(new ConsoleCommand("SM - Two", () => { Console.WriteLine("Command SM - Two"); Console.ReadKey(); }));
            main.AddOption(new ConsoleCommand("SM - Three", () => { Console.WriteLine("Command SM - Three"); Console.ReadKey(); }));
            main.AddOption(new ConsoleCommand("SM - Four", () => { Console.WriteLine("Command SM - Four"); Console.ReadKey(); }));

            return(new ConsoleMachine("Sub-Machine", main));
        }
예제 #4
0
        static void Main(string[] args)
        {
            ConsoleSelect main = new ConsoleSelect("Main", "Main Menu");

            ConsoleSelect first = new ConsoleSelect("First", "First menu");

            first.AddOption(new ConsoleCommand("Command One", () => { Console.WriteLine("Command One"); Console.ReadKey(); }));
            first.AddOption(new ConsoleCommand("Command Two", () => { Console.WriteLine("Command Two"); Console.ReadKey(); }));
            first.AddOption(new ConsoleCommand("Command Three", () => { Console.WriteLine("Command Three"); Console.ReadKey(); }));
            first.AddOption(new ConsoleCommand("Command Four", () => { Console.WriteLine("Command Four"); Console.ReadKey(); }));
            first.AddOption(new ConsoleCommand("Write Tree", () => { ConsoleMachine.CurrentMachine.WriteTree(); }));


            ConsoleSelect second = new ConsoleSelect("Second", "Second menu");

            ConsoleSelect secondOne = new ConsoleSelect("One", "Second menu - [1]");

            secondOne.AddOption(new ConsoleCommand("My method", MyMethod));
            secondOne.AddOption(new ConsoleCommand("Paint", Paint.StartPaint));
            secondOne.AddOption(new ConsoleCommand("Force exit", () => ConsoleMachine.CurrentMachine.Exit()));

            second.AddOption(secondOne);
            second.AddOption(new ConsoleSelect("Two", "Second menu - [2]"));
            second.AddOption(new ConsoleSelect("Three", "Second menu - [3]"));

            ConsoleSelect third = new ConsoleSelect("Third", "Third menu");

            third.AddOption(CreateSubMachine());

            ConsoleSelect fourth = new ConsoleSelect("Fourth", "Fourth menu");

            main.AddOption(first);
            main.AddOption(second);
            main.AddOption(third);
            main.AddOption(fourth);

            ConsoleMachine.Start(main);
        }
예제 #5
0
        public void Insert()
        {
            Query.Change(
                @"
                    INSERT INTO Console (Name, HomeConsole, PortableConsole)
                    VALUES (@Name, @HomeConsole, @PortableConsole)
                ",
                new
            {
                Name            = "Virtual Boy",
                HomeConsole     = false,
                PortableConsole = true,
            }
                );

            var virtualBoy = Query.SelectExactlyOne <Console>(ConsoleSelect.Where("Id = 13"));
            var expected   = new Console[Console.NintendoConsoles.Length + 1];
            var actual     = Query.Select <Console>(ConsoleSelect).ToArray();

            Array.Copy(Console.NintendoConsoles, expected, Console.NintendoConsoles.Length);
            expected[expected.Length - 1] = virtualBoy;

            CollectionAssert.AreEqual(expected, actual);
        }
예제 #6
0
 public void OrderByDesc() => CollectionAssert.AreEqual(
     Console.NintendoConsoles.OrderByDescending(c => c.Name).ToArray(),
     Query.Select <Console>(ConsoleSelect.OrderByDesc("NAME")).ToArray()
     );
예제 #7
0
 public void WhereAndMethod() => Assert.AreEqual(
     Console.Switch,
     Query.SelectExactlyOne <Console>(
         ConsoleSelect.WhereAnd("HomeConsole = 1").WhereAnd("PortableConsole = 1")
         )
     );