コード例 #1
0
 public void AddProcessor(StateProcessorBase newProcessor)
 {
     if (_root == null)
     {
         _root = newProcessor;
     }
     else
     {
         AddProcessor(_root, newProcessor);
     }
 }
コード例 #2
0
 public void RemoveProcessor(StateProcessorBase removedProcessor)
 {
     if (_root == removedProcessor)
     {
         _root = null;
     }
     else
     {
         RemoveProcessor(_root, removedProcessor);
     }
 }
コード例 #3
0
 private void RemoveProcessor(StateProcessorBase currentProcessor, StateProcessorBase removedProcessor)
 {
     if (currentProcessor.Next == removedProcessor)
     {
         currentProcessor.Next = removedProcessor.Next;
     }
     else if (currentProcessor.Next != null)
     {
         RemoveProcessor(currentProcessor.Next, removedProcessor);
     }
 }
コード例 #4
0
 private void AddProcessor(StateProcessorBase currentProcessor, StateProcessorBase newProcessor)
 {
     if (currentProcessor.Next == null || currentProcessor.Next.Priority >= newProcessor.Priority)
     {
         newProcessor.Next     = currentProcessor.Next;
         currentProcessor.Next = newProcessor;
     }
     else
     {
         AddProcessor(currentProcessor.Next, newProcessor);
     }
 }