protected Dictionary <AttrType, float> GetDataPool(DataManager.DataPoolType type) { if (!this._dataPool.ContainsKey(type)) { this._dataPool.Add(type, new Dictionary <AttrType, float>()); } return(this._dataPool[type]); }
public float GetAttr(DataManager.DataPoolType DataPoolType, AttrType type) { Dictionary <AttrType, float> dataPool = this.GetDataPool(DataPoolType); if (!dataPool.ContainsKey(type)) { dataPool.Add(type, 0f); } return(dataPool[type]); }
protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value) { Dictionary <AttrType, float> dataPool = this.GetDataPool(dataPoolType); if (!dataPool.ContainsKey(attrType)) { dataPool.Add(attrType, value); } else { dataPool[attrType] = value; } return(value); }
protected float SetAttr(DataManager.DataPoolType dataPoolType, AttrType attrType, float value) { if (CharacterDataMgr.instance != null && dataPoolType == DataManager.DataPoolType.CurrentData) { AttrNumberData attrNumberData = CharacterDataMgr.instance.GetAttrNumberData(attrType); if (attrNumberData != null) { if (value > attrNumberData.m_fMaxValue) { value = attrNumberData.m_fMaxValue; } else if (value < attrNumberData.m_fMinValue) { value = attrNumberData.m_fMinValue; } } } this._dataPool[(int)dataPoolType][(int)attrType] = value; if (dataPoolType == DataManager.DataPoolType.CurrentData && this.self.isPlayer) { switch (attrType) { case AttrType.Attack: case AttrType.Armor: case AttrType.MoveSpeed: case AttrType.AttackSpeed: goto IL_AA; case AttrType.DodgeProp: IL_90: switch (attrType) { case AttrType.MagicResist: case AttrType.MagicPower: goto IL_AA; } return(value); } goto IL_90; IL_AA: MobaMessage message = MobaMessageManager.GetMessage((ClientMsg)25057, new MsgData_AttrChangeData { nType = (int)attrType, fValue = value }, 0f); MobaMessageManager.ExecuteMsg(message); } return(value); }
protected float[] GetDataPool(DataManager.DataPoolType type) { return(this._dataPool[(int)type]); }
public float GetAttr(DataManager.DataPoolType DataPoolType, AttrType type) { return(this._dataPool[(int)DataPoolType][(int)type]); }