Exemple #1
0
 public void Reset()
 {
     this.setIterator = new IteratorAdapter(actorTreeSet.subSets.GetEnumerator());
     for (this.currentSet = (ActorSet)this.setIterator.Next(); this.currentSet
          .IsEmpty() && this.setIterator.HasNext(); this.currentSet = (ActorSet)this.setIterator
                                                                      .Next())
     {
     }
     this.actorIterator = this.currentSet.Iterator();
 }
Exemple #2
0
 public bool HasNext()
 {
     if (this.actorIterator.HasNext())
     {
         return(true);
     }
     else if (!this.setIterator.HasNext())
     {
         return(false);
     }
     else
     {
         while (this.setIterator.HasNext())
         {
             this.currentSet = (ActorSet)this.setIterator.Next();
             if (!this.currentSet.IsEmpty())
             {
                 break;
             }
         }
         this.actorIterator = this.currentSet.Iterator();
         return(this.actorIterator.HasNext());
     }
 }
Exemple #3
0
 public ActorSetIterator(ActorSet set)
 {
     this.actorSet = set;
     this.currentNode = actorSet.listHeadTail;
 }
Exemple #4
0
            public void SetHashListHead(ActorSet.ListNode oldHead)
            {
                if (oldHead == null)
                {
                    this.nextHash = this;
                    this.prevHash = this;
                }
                else
                {
                    this.nextHash = oldHead;
                    this.prevHash = oldHead.prevHash;
                    oldHead.prevHash = this;
                    this.prevHash.nextHash = this;
                }

            }
Exemple #5
0
 public ListNode(Actor actor, ActorSet.ListNode listTail)
 {
     this.actor = actor;
     this.next = listTail.next;
     this.prev = listTail;
     listTail.next = this;
     this.next.prev = this;
 }
Exemple #6
0
        private void Remove(ActorSet.ListNode actorNode)
        {
            int seq = actorNode.actor.GetSequenceNumber();
            int hash = seq % this.hashMap.Length;
            if (this.hashMap[hash] == actorNode)
            {
                this.hashMap[hash] = actorNode.nextHash;
                if (this.hashMap[hash] == actorNode)
                {
                    this.hashMap[hash] = null;
                }
            }

            actorNode.Remove();
            --this.numActors;
            if (this.numActors <= this.hashMap.Length / 2)
            {
                this.Resize();
            }

        }
Exemple #7
0
 public ActorSetIterator(ActorSet set)
 {
     this.actorSet    = set;
     this.currentNode = actorSet.listHeadTail;
 }