Beispiel #1
0
        public Event Read()
        {
            if (this.eventTreeItem_1 != null)
            {
                throw new Exception("EventTree::Read Can not read from a tree with empty queue");
            }
            EventTreeItem eventTreeItem  = this.eventTreeItem_0;
            EventTreeItem eventTreeItem2 = null;

            while (eventTreeItem.eventTreeItem_0 != null)
            {
                eventTreeItem2 = eventTreeItem;
                eventTreeItem  = eventTreeItem.eventTreeItem_0;
            }
            if (eventTreeItem.eventTreeItem_3 != null)
            {
                EventTreeItem eventTreeItem_ = eventTreeItem.eventTreeItem_4;
                eventTreeItem.eventTreeItem_4.eventTreeItem_2.eventTreeItem_3 = null;
                eventTreeItem.eventTreeItem_4 = eventTreeItem.eventTreeItem_4.eventTreeItem_2;
                eventTreeItem = eventTreeItem_;
            }
            else
            {
                if (eventTreeItem2 != null)
                {
                    eventTreeItem2.eventTreeItem_0 = eventTreeItem.eventTreeItem_1;
                }
                else
                {
                    this.eventTreeItem_0 = eventTreeItem.eventTreeItem_1;
                }
                eventTreeItem.eventTreeItem_1 = null;
            }
            Event @event = eventTreeItem.queue.Read();

            if (@event.TypeId == EventType.OnQueueClosed)
            {
                if (this.eventTreeItem_0 == null)
                {
                    @event = new OnSimulatorStop();
                }
            }
            else if (eventTreeItem.queue.IsEmpty())
            {
                this.eventTreeItem_1 = eventTreeItem;
            }
            else
            {
                this.method_0(eventTreeItem);
            }
            return(@event);
        }
Beispiel #2
0
 public Event Read()
 {
     if (this.eventTreeItem_1 != null)
     {
         throw new Exception("EventTree::Read Can not read from a tree with empty queue");
     }
     EventTreeItem eventTreeItem = this.eventTreeItem_0;
     EventTreeItem eventTreeItem2 = null;
     while (eventTreeItem.eventTreeItem_0 != null)
     {
         eventTreeItem2 = eventTreeItem;
         eventTreeItem = eventTreeItem.eventTreeItem_0;
     }
     if (eventTreeItem.eventTreeItem_3 != null)
     {
         EventTreeItem eventTreeItem_ = eventTreeItem.eventTreeItem_4;
         eventTreeItem.eventTreeItem_4.eventTreeItem_2.eventTreeItem_3 = null;
         eventTreeItem.eventTreeItem_4 = eventTreeItem.eventTreeItem_4.eventTreeItem_2;
         eventTreeItem = eventTreeItem_;
     }
     else
     {
         if (eventTreeItem2 != null)
         {
             eventTreeItem2.eventTreeItem_0 = eventTreeItem.eventTreeItem_1;
         }
         else
         {
             this.eventTreeItem_0 = eventTreeItem.eventTreeItem_1;
         }
         eventTreeItem.eventTreeItem_1 = null;
     }
     Event @event = eventTreeItem.queue.Read();
     if (@event.TypeId == EventType.OnQueueClosed)
     {
         if (this.eventTreeItem_0 == null)
         {
             @event = new OnSimulatorStop();
         }
     }
     else if (eventTreeItem.queue.IsEmpty())
     {
         this.eventTreeItem_1 = eventTreeItem;
     }
     else
     {
         this.method_0(eventTreeItem);
     }
     return @event;
 }