Пример #1
0
 public void ProcessPowerQueue()
 {
     while (((this.m_powerQueue.Count > 0) && !this.IsBusy()) && !GameState.Get().IsBusy())
     {
         if (this.m_busyTaskList != null)
         {
             this.m_busyTaskList = null;
         }
         else
         {
             PowerTaskList taskList = this.m_powerQueue.Peek();
             if (this.m_historyBlockingTaskList != null)
             {
                 if (!taskList.IsDescendantOfBlock(this.m_historyBlockingTaskList))
                 {
                     break;
                 }
             }
             else if ((HistoryManager.Get() != null) && (HistoryManager.Get().GetCurrentBigCard() != null))
             {
                 break;
             }
             this.NotifyWillProcessTaskList(taskList);
             if (GameState.Get().IsBusy())
             {
                 this.m_busyTaskList = taskList;
                 break;
             }
         }
         if (this.CanEarlyConcede())
         {
             if ((this.m_earlyConcedeTaskList == null) && !this.m_handledFirstEarlyConcede)
             {
                 this.ForceEarlyConcedeVisuals();
                 this.m_handledFirstEarlyConcede = true;
             }
             while (this.m_powerQueue.Count > 0)
             {
                 this.m_currentTaskList = this.m_powerQueue.Dequeue();
                 this.m_currentTaskList.DebugDump();
                 this.CancelSpellsForEarlyConcede(this.m_currentTaskList);
                 this.m_currentTaskList.DoEarlyConcedeTasks();
                 this.m_currentTaskList = null;
             }
             break;
         }
         this.m_currentTaskList = this.m_powerQueue.Dequeue();
         this.m_currentTaskList.DebugDump();
         this.PrepareHistoryForCurrentTaskList();
         this.StartCurrentTaskList();
     }
 }