Ejemplo n.º 1
0
 private void DequueLogicAction()
 {
     try
     {
         LogicAction action = null;
         do
         {
             action = null;
             lock (m_QueueLogicAction)
             {
                 if (0 < m_QueueLogicAction.Count)
                 {
                     action = m_QueueLogicAction.Dequeue();//移除并返回栈顶数据
                 }
             }
             if (null != action)
             {
                 action.ProcessAction();
             }
         } while (action != null);
     }
     catch (Exception ex)
     {
         DebugMod.LogException(ex);
     }
 }
Ejemplo n.º 2
0
        public bool CallLogicAction(ActionDefine actionType, ActionParam param)
        {
            try
            {
                LogicAction action = (LogicAction)LogicActionFactory.Instance.CreateAction(actionType);
                if (null == action)
                {
                    return(false);
                }
                action.ActionId = (int)actionType;
                action.ActParam = param;

                lock (m_QueueLogicAction)
                {
                    m_QueueLogicAction.Enqueue(action);
                }
                return(true);
            }
            catch (Exception ex)
            {
                DebugMod.LogException(ex);
                return(false);
            }
        }