Пример #1
0
        public bool Init()
        {
            for (CombatAttrType i = CombatAttrType.Attack; i < CombatAttrType.CombatAttrType_Count; ++i)
            {
                switch (i)
                {
                case CombatAttrType.Attack:
                case CombatAttrType.Attack_Add:
                case CombatAttrType.Gold_Add:
                case CombatAttrType.Life_Add:
                {
                    mProperties.Add(i, new PropertyData(0));
                }
                break;

                case CombatAttrType.MoveSpeed:
                case CombatAttrType.Crit_Rate:
                case CombatAttrType.Crit_Damage:
                case CombatAttrType.Dodge:
                case CombatAttrType.Attack_Speed:
                {
                    mProperties.Add(i, new PropertyData(1));
                }
                break;
                }
            }

            return(true);
        }
Пример #2
0
 public void Revise(CombatAttrType propertyID, float value)
 {
     if (!mProperties.ContainsKey(propertyID))
     {
         return;
     }
     mProperties[propertyID].Revise(value);
 }
Пример #3
0
        public float GetValue(CombatAttrType propertyID)
        {
            PropertyData data;

            if (!mProperties.TryGetValue(propertyID, out data))
            {
                return(0.0f);
            }
            return(data.GetValue());
        }