Пример #1
0
 public ConsoleWorker(String startString, String exitString)
 {
     Console.WriteLine(startString);
     this.exitString = exitString;
     this.cm         = CommandManager.get;
     SVars.Register("exit", false);
 }
Пример #2
0
        static void Main(string[] args)
        {
            for (int i = 0; i < args.Length; i++)
            {
                Console.WriteLine(i.ToString() + ": " + args[i]);
                //ProcessUtils.StartProcess(args[i]);
                SVars.Add("game", args[i]);
            }

            new MainManager();

            Console.WriteLine("Press any key to continue...");
            Console.ReadKey();
        }
Пример #3
0
        public void Listen()
        {
            String line;

            do
            {
                Console.Write(">");
                line = Console.ReadLine();
                String[] args = splitArgs(line);

                ICommand c = cm.Input(args);
                if (c == null && line != exitString)
                {
                    Console.WriteLine("Unknown command");
                }
            } while (!SVars.getValue <bool>("exit") && !exitString.Equals(line));
            Console.WriteLine("Goodbye!");
        }