public override void Entry()
 {
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.WriteLine("Demo Start");
     Thread.Sleep(1000);
     Program.Context.CurrentState = new MenuState();
 }
 public override void Do()
 {
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.WriteLine("Demo Listen State\n");
     _message += @"        8       " + "\n";
     _message += @"       /\       " + "\n";
     _message += @"       ||       " + "\n";
     _message += @"4 <===  5 ===> 6" + "\n";
     _message += @"       ||       " + "\n";
     _message += @"       \/       " + "\n";
     _message += @"        2       " + "\n";
     _message += @"Home:1    Back:3" + "\n";
     ConsoleDisplayN18.WriteLine(_message);
 }
        public override void Do()
        {
            ConsoleDisplayN18.Clear();

            ConsoleDisplayN18.WriteLine(_title + "\n");
            for (uint i = 0; i < _menu.Length; i++)
            {
                if (i == Cursor)
                {
                    ConsoleDisplayN18.WriteLine("=>" + _menu[i] + "<=");
                }
                else
                {
                    ConsoleDisplayN18.WriteLine(_menu[i]);
                }
            }
        }
Exemple #4
0
        private void Listen()
        {
            string command = "";

            if (!_stopListen)
            {
                command = Console.ReadLine();
                ConsoleDisplayN18.ClearLine();
                switch (command)
                {
                case "4":    //Joystick .LeftArrow: //Do something
                    JoystickPosition(-1, 0);
                    break;

                case "8":    //Joystick.UpArrow:  //Do something
                    JoystickPosition(0, 1);
                    break;

                case "6":    //Joystick.RightArrow: //Do something
                    JoystickPosition(1, 0);
                    break;

                case "2":    //Joystick.DownArrow: //Do something
                    JoystickPosition(0, -1);
                    break;

                case "5":     //Joystick button
                    JoystickPressed();
                    break;

                case "1":     //Left button
                    ButtonLeftPressed();
                    break;

                case "3":     //right button
                    ButtonRightPressed();
                    break;
                }
                if (command != "q" || command != "Q")
                {
                    Listen();
                }
            }
        }
Exemple #5
0
        public static void Main(string[] args)
        {
            ConsoleDisplayN18.setConsoleSize();

            /*ConsoleDisplayN18.Clear();
             * ConsoleDisplayN18.WriteLine("Size Display : " + Console.BufferWidth + "x" + Console.BufferHeight);
             * ConsoleDisplayN18.WriteLine("Line 2");
             * ConsoleDisplayN18.WriteLine("Line 3");
             * ConsoleDisplayN18.WriteLine("Line 4");
             * ConsoleDisplayN18.WriteLine("Line 5");
             * ConsoleDisplayN18.WriteLine("0123456789X123........456789X123456___________789X12345");
             * ConsoleDisplayN18.WriteLine("Line 9\nLine 10\nLine 11\nLine 12\nLine 13");
             */
            State      startState = new SplashScreenState();
            ErrorState errorState = new ErrorState();

            _Context = new Context(startState, errorState);
            _Context.Start();
        }
Exemple #6
0
 public override void Entry()
 {
     ConsoleDisplayN18.Clear();
     ConsoleDisplayN18.WriteLine(Error.Message + " " + Error.StackTrace);
 }