Exemplo n.º 1
0
        void Enhance(AValueStruct pVS, AValueMask pMask, bool bLinear) // 将pStruct的属性数值强化给自己
        {
            if (null == pVS)
            {
                return;
            }
            if (null != pMask)
            {
                EnhanceWithMask(pVS, pMask, bLinear);
                return;
            }

            for (int i = 0; i < (int)AValueType.Count; i++)
            {
                AValueData pDstData = GetValueData(i, false);
                if (null != pDstData)
                {
                    // 如果装备属性项不存在,强化属性集无效果
                    AValueData pSrcData = pVS.GetValueData(i, false);
                    if (null != pSrcData)
                    {
                        pDstData.Combine(pSrcData, ref bLinear);
                    }
                }
            }
        }
Exemplo n.º 2
0
 void CombineWithMask(AValueStruct pVS, AValueMask pMask, bool bLinear) // 将pStruct的属性数值合并给自己
 {
     foreach (KeyValuePair <int, AValueData> item in pVS.Datas)
     {
         if (pMask.Mask[item.Key])
         {
             AValueData pDstData = GetValueData(item.Key, true);
             if (null != pDstData)
             {
                 pDstData.Combine(item.Value, ref bLinear);
             }
         }
     }
 }
Exemplo n.º 3
0
 void EnhanceWithMask(AValueStruct pVS, AValueMask pMask, bool bLinear)
 {
     for (int i = 0; i < (int)AValueType.Count; i++)
     {
         if (pMask.Mask[i])
         {// 标脏的数值才进行合并
             AValueData pDstData = GetValueData(i, false);
             if (null != pDstData)
             {// 如果装备属性项不存在,强化属性集无效果
                 AValueData pSrcData = pVS.GetValueData(i, false);
                 if (null != pSrcData)
                 {
                     pDstData.Combine(pSrcData, ref bLinear);
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
        public void Combine(AValueStruct pVS, AValueMask pMask, bool bLinear) // 将pStruct的属性数值合并给自己
        {
            if (null == pVS)
            {
                return;
            }

            if (null != pMask)
            {
                CombineWithMask(pVS, pMask, bLinear);
                return;
            }

            foreach (KeyValuePair <int, AValueData> item in pVS.Datas)
            {
                AValueData pDstData = GetValueData(item.Key, true);
                if (null != pDstData)
                {
                    pDstData.Combine(item.Value, ref bLinear);
                }
            }
        }