Ejemplo n.º 1
0
 public static void MoveActionQueue()//chama a proxima ação da fila
 {
     if ((userActions.Count > 0))
     {
         var usrAction = userActions.Dequeue();
         OnCommandCalled?.Invoke(null, usrAction); // a ação atual é a da frente na fila
         currentUAction = new UActionHolder {
             userAction = usrAction, t0 = Time.time, done = false
         };
     }
     else
     {
         currentUAction = null;
     }
 }
Ejemplo n.º 2
0
        private void Read()
        {
            while (IsListening)
            {
                string raw      = Console.ReadLine();
                bool   suitable = false;

                foreach (var cmd in AvailableCommands)
                {
                    if (cmd.IsSuitableHandler(raw))
                    {
                        OnCommandCalled?.Invoke(cmd);

                        suitable = true;
                        cmd.Run(raw);
                    }
                }

                if (!suitable)
                {
                    OutMgr.Instance.WriteLine($"Incorrect command typed: '{raw}'. Use .help for more details", OutLevel.Error);
                }
            }
        }
 public void Execute(object parameter)
 {
     OnCommandCalled?.Invoke(parameter);
 }