Esempio n. 1
0
        public int GetAllSwordsManCombatValue()
        {
            int CombatValue = 0;

            for (int i = 0; i < m_Items.Count; ++i)
            {
                SwordsMan item = m_Items[i];
                if (null != item && item.IsValid())
                {
                    CombatValue += item.GetCombatValue();
                }
            }
            return(CombatValue);
        }
Esempio n. 2
0
        /// <summary>
        /// 有效物品数量
        /// </summary>
        /// <returns></returns>
        public int GetSwordsManCount()
        {
            int count = 0;

            for (int i = 0; i < m_Items.Count; ++i)
            {
                SwordsMan item = m_Items[i];
                if (null != item && item.IsValid())
                {
                    ++count;
                }
            }
            return(count);
        }
Esempio n. 3
0
        static public List <SwordsMan> ItemFilter(SwordsManContainer oContainer)
        {
            if (null == oContainer)
            {
                return(null);
            }

            List <SwordsMan> resultlist = new List <SwordsMan>();

            for (int nIndex = 0; nIndex < oContainer.ContainerSize; ++nIndex)
            {
                SwordsMan oSwordsMan = oContainer.GetSwordsMan(nIndex);
                if (null != oSwordsMan && oSwordsMan.IsValid())
                {
                    resultlist.Add(oSwordsMan);
                }
            }
            return(ItemSort(resultlist));
        }
Esempio n. 4
0
        /// <summary>
        /// 筛选出高于品质的物品
        /// </summary>
        /// <param name="ItemList"></param>
        /// <param name="nQuality"></param>
        /// <returns></returns>
        static public List <SwordsMan> ItemFilter(List <SwordsMan> ItemList, int nQuality)
        {
            if (null == ItemList)
            {
                return(null);
            }

            List <SwordsMan> resultlist = new List <SwordsMan>();

            for (int nIndex = 0; nIndex < ItemList.Count; ++nIndex)
            {
                SwordsMan item = ItemList[nIndex];
                if (null != item && item.IsValid())
                {
                    if (item.Quality <= nQuality)
                    {
                        resultlist.Add(item);
                    }
                }
            }
            return(ItemSort(resultlist));
        }