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

            node.next = null;
            ClearQueueTopDown(temp);
        }
Exemple #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;
 }
Exemple #5
0
 public CommandLinkedList(Firebase _firebase, FirebaseCommand _command, string _param, object _valObj)
 {
     firebase = _firebase;
     command  = _command;
     param    = _param;
     valObj   = _valObj;
     valStr   = null;
     next     = null;
 }
 protected void ClearQueueTopDown(CommandLinkedList node)
 {
     if (node == null)
         return;
     
     CommandLinkedList temp = node.next;
     ClearQueueTopDown(temp);
     node.next = null;
 }
Exemple #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;
 }
        /// <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();
                }
            }
        }
        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;
        }
Exemple #12
0
 public void AddNext(CommandLinkedList _next)
 {
     next = _next;
 }
Exemple #13
0
 protected void StartNextCommand()
 {
     head = head.next;
     Start();
 }
Exemple #14
0
        protected void AddQueue(Firebase firebase, FirebaseCommand command, string param, object valObj)
        {
            CommandLinkedList commandNode = new CommandLinkedList(firebase, command, param, valObj);

            InsertNodeToQueue(commandNode);
        }
Exemple #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);
        }