示例#1
0
 public void Update(DDDServerConnection serverConnection, DMView dmView)
 {
     if (m_behaviorQueue.Count >= 1)
     {
         //Console.Out.WriteLine(String.Format("ObjectControlAgent.Update() {0}",simObject.ID));
         if (m_currentBehavior != m_behaviorQueue[0])
         {
             m_currentBehavior = m_behaviorQueue[0];
             //Console.Out.WriteLine(String.Format("ObjectControlAgent.Update() starting {0} for {1}",m_currentBehavior.GetName(), simObject.ID));
             m_currentBehavior.Start(serverConnection, dmView);
         }
         m_currentBehavior.Update(serverConnection, dmView);
         if (m_currentBehavior.IsDone(serverConnection, dmView))
         {
             //Console.Out.WriteLine(String.Format("ObjectControlAgent.Update(){0} is done for {1}", m_currentBehavior.GetName(), simObject.ID));
             m_behaviorQueue.Remove(m_currentBehavior);
             m_currentBehavior = null;
         }
     }
     else
     {
         m_currentBehavior = null;
     }
 }