Ejemplo n.º 1
0
        /// <summary>
        /// Set up the program witht he proper configuration
        /// </summary>
        public static void Init(ZTaskManager manager, ZCommandProcessor processor)
        {
            try // use a try here such that if the file reading fails the program won't break
            {
                Print(File.ReadAllText("introduction.txt"));
            }
            catch (Exception e)
            {
                ZDebugUtil.PrintError(e);
            }

            Print("Loading ...");

            manager.LoadFromDisk();
        }
Ejemplo n.º 2
0
        public static void Main(String[] args)
        {
            ZTaskManager      manager   = new ZTaskManager();
            ZCommandProcessor processor = new ZCommandProcessor(manager);

            Init(manager, processor);
            Print("Loading Complete ...\n");

            bool quit = false;

            while (!quit)
            {
                Prompt("> ");
                string command = Console.ReadLine().Purify();
                if (!String.IsNullOrEmpty(command))
                {
                    var commands = command.Split(null);
                    quit = processor.ProcessCommand(commands);
                }
            }

            Print("Program ends ...");
            Thread.Sleep(3000);
        }
 public ZCommandExecutor(ZTaskManager manager, ZConsoleReader reader)
 {
     this.manager = manager;
     this.reader  = reader;
     cmdMap       = new ZCommandMap();
 }
 public ZCommandProcessor(ZTaskManager manager)
 {
     this.manager = manager;
     reader       = new ZConsoleReader(manager);
     executor     = new ZCommandExecutor(manager, reader);
 }
 public void SetUpTest()
 {
     manager = new ZTaskManager();
 }
 public void SetUpTest()
 {
     manager   = new ZTaskManager();
     processor = new ZCommandProcessor(manager);
 }
Ejemplo n.º 7
0
 public ZConsoleReader(ZTaskManager manager)
 {
     this.manager = manager;
 }