コード例 #1
0
 public void Destroy()
 {
     Active   = null;
     inActive = null;
 }
コード例 #2
0
        public void Add(TimeSpan TargetTime, Object obj, ExecuteAction inCallBack)
        {
            if (inActive == null)
            {
                Create(deltaGrow);
            }

            TimeEvent current = inActive;

            current.targetTime = TargetTime;
            current.data       = obj;
            current.Callback   = inCallBack;

            if (Active != null)
            {
                TimeEvent Acurrent = Active;
                inActive = current.next;

                if (Acurrent.targetTime > current.targetTime)
                {
                    Active        = current;
                    Active.next   = Acurrent;
                    Acurrent.prev = Active;
                    Active.prev   = null;
                }
                else
                {
                    while (Acurrent != null)
                    {
                        if (Acurrent.next != null)
                        {
                            if (Acurrent.targetTime > current.targetTime)
                            {
                                current.next = Acurrent;
                                current.prev = Acurrent.prev;

                                Acurrent.prev.next = current;
                                Acurrent.prev      = current;

                                break;
                            }
                        }
                        else
                        {
                            current.next = null;
                            current.prev = Acurrent;

                            Acurrent.next = current;
                            Acurrent      = current;
                            break;
                        }

                        Acurrent = Acurrent.next;
                    }
                }
            }
            else
            {
                inActive = current.next;

                Active      = current;
                Active.next = null;
                Active.prev = null;
            }
        }