예제 #1
0
        public void ExecuteCommand(string command, string[] arguments)
        {
            IConsoleCommand consoleCommand;
            if (TryGet(command, out consoleCommand))
            {
                var commandToExecute = new ConsoleCommandInstance(this, consoleCommand, arguments);

                // todo: add multy threading
                commandsQueue.Enqueue(commandToExecute);
            }
        }
예제 #2
0
 // Update is called once per frame
 public void Update()
 {
     if (currentCommand == null && commandsQueue.Count > 0)
     {
         // todo: add multy threading
         currentCommand = commandsQueue.Dequeue();
         currentCommand.Command.Action(currentCommand.Arguments);
         currentCommand = null;
     }
 }