protected void ClearQueueTopDown(CommandLinkedList node)
        {
            CommandLinkedList temp = node.next;

            node.next = null;
            ClearQueueTopDown(temp);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Force stop the command queue chain and clears the queue. Warning: processed command cannot be undone.
 /// </summary>
 public void ForceClearQueue()
 {
     FirebaseManager.Instance.StopCoroutine("DelayedDoCommand");
     ClearQueueTopDown(head);
     head = null;
     tail = null;
     System.GC.Collect();
 }
 public CommandLinkedList(Firebase _firebase, FirebaseCommand _command, FirebaseParam firebaseParam, object _obj = null)
 {
     firebase = _firebase;
     command  = _command;
     param    = firebaseParam.Parameter;
     obj      = _obj;
     next     = null;
 }
 public CommandLinkedList(Firebase _firebase, FirebaseCommand _command, string _param, object _obj = null)
 {
     firebase = _firebase;
     command  = _command;
     param    = _param;
     obj      = _obj;
     next     = null;
 }
Exemplo n.º 5
0
 public CommandLinkedList(Firebase _firebase, FirebaseCommand _command, string _param, object _valObj)
 {
     firebase = _firebase;
     command  = _command;
     param    = _param;
     valObj   = _valObj;
     valStr   = null;
     next     = null;
 }
Exemplo n.º 6
0
 protected void ClearQueueTopDown(CommandLinkedList node)
 {
     if (node == null)
         return;
     
     CommandLinkedList temp = node.next;
     ClearQueueTopDown(temp);
     node.next = null;
 }
Exemplo n.º 7
0
 public CommandLinkedList(Firebase _firebase, FirebaseCommand _command, string _param, string _valStr, bool _isJson)
 {
     firebase = _firebase;
     command  = _command;
     param    = _param;
     valObj   = null;
     valStr   = _valStr;
     isJson   = _isJson;
     next     = null;
 }
Exemplo n.º 8
0
        /// <summary>
        /// Start processing the queue until all commands completed, or, an error occured and number of allowed retries is over the limit.
        /// </summary>
        public void Start()
        {
            retryCounter = 0;

            if (head != null)
                head.DoCommand();
            else
            {
                tail = null;

                if (OnQueueCompleted != null)
                    OnQueueCompleted();
            }
        }
        protected void StartNextCommand()
        {
            head = head.next;
            if (head != null)
            {
                head.DoCommand();
            }
            else
            {
                tail = null;

                if (OnQueueFinished != null)
                {
                    OnQueueFinished();
                }
            }
        }
Exemplo n.º 10
0
        void InsertNodeToQueue(CommandLinkedList commandNode)
        {
            if (head == null)
            {
                head = commandNode;
                tail = commandNode;

                if (autoStart)
                    head.DoCommand();
            }
            else
            {
                tail.next = commandNode;
                tail = commandNode;
            }

            ++count;
        }
        protected void AddQueue(Firebase firebase, FirebaseCommand command, string param, object obj = null)
        {
            CommandLinkedList commandNode = new CommandLinkedList(firebase, command, param, obj);

            if (head == null)
            {
                head = commandNode;
                tail = commandNode;

                if (autoStart)
                {
                    head.DoCommand();
                }
            }
            else
            {
                tail.next = commandNode;
                tail      = commandNode;
            }

            ++count;
        }
Exemplo n.º 12
0
 public void AddNext(CommandLinkedList _next)
 {
     next = _next;
 }
Exemplo n.º 13
0
 protected void StartNextCommand()
 {
     head = head.next;
     Start();
 }
Exemplo n.º 14
0
        protected void AddQueue(Firebase firebase, FirebaseCommand command, string param, object valObj)
        {
            CommandLinkedList commandNode = new CommandLinkedList(firebase, command, param, valObj);

            InsertNodeToQueue(commandNode);
        }
Exemplo n.º 15
0
        protected void AddQueue(Firebase firebase, FirebaseCommand command, string param, string valStr, bool parseToJson)
        {
            CommandLinkedList commandNode = new CommandLinkedList(firebase, command, param, valStr, parseToJson);

            InsertNodeToQueue(commandNode);
        }