Exemple #1
0
 public Running(AccountUC accountform)
 {
     account           = accountform;
     m_Openning        = null;
     m_Leaving         = null;
     m_Getting         = null;
     m_CurrentPetIndex = 0;
 }
Exemple #2
0
 public Running()
 {
     m_Openning        = null;
     m_Leaving         = null;
     m_Getting         = null;
     OnSafe            = false;
     m_CurrentPetIndex = 0;
 }
Exemple #3
0
        public void GettingFoodFromSafe()
        {
            if (m_Getting == null)
            {
                m_Getting = new Getting(account);
            }

            m_Getting.Init();
        }
Exemple #4
0
Fichier : Pool.cs Projet : GF47/GRT
        /// <summary>
        /// 从池中获取一个实例
        /// </summary>
        /// <param name="callback">获取实例时对其进行必要的处理</param>
        public T Get(Action <T> callback = null)
        {
            T item;

            if (_queue.Count == 0)
            {
                item = _createNewFunc();
                callback?.Invoke(item);
                Getting?.Invoke(item);
                return(item);
            }
            item = _queue.Dequeue();
            callback?.Invoke(item);
            Getting?.Invoke(item);
            return(item);
        }