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); }
public void Revise(CombatAttrType propertyID, float value) { if (!mProperties.ContainsKey(propertyID)) { return; } mProperties[propertyID].Revise(value); }
public float GetValue(CombatAttrType propertyID) { PropertyData data; if (!mProperties.TryGetValue(propertyID, out data)) { return(0.0f); } return(data.GetValue()); }