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(); }
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()); } }
public ActorSetIterator(ActorSet set) { this.actorSet = set; this.currentNode = actorSet.listHeadTail; }
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; } }
public ListNode(Actor actor, ActorSet.ListNode listTail) { this.actor = actor; this.next = listTail.next; this.prev = listTail; listTail.next = this; this.next.prev = this; }
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(); } }