using UnityEngine; using System.Collections; using System.Collections.Generic; using GCGame.Table; public class AdvanceData { #region private int m_RideGrade; public int RideGrade { set { m_RideGrade = value; } get { return m_RideGrade; } } private int m_RideLevel; public int RideLevel { set { m_RideLevel = value; } get { return m_RideLevel; } } private int m_WingGrade; public int WingGrade { set { m_WingGrade = value; } get { return m_WingGrade; } } private int m_WingLevel; public int WingLevel { set { m_WingLevel = value; } get { return m_WingLevel; } } private int m_GodWeaponLevel; public int GodWeaponLevel { set { m_GodWeaponLevel = value; } get { return m_GodWeaponLevel; } } private int m_GodWeaponGrade; public int GodWeaponGrade { set { m_GodWeaponGrade = value; } get { return m_GodWeaponGrade; } } private int m_WishGrade; public int WishGrade { set { m_WishGrade = value; } get { return m_WishGrade; } } private int m_WishLevel; public int WishLevel { set { m_WishLevel = value; } get { return m_WishLevel; } } private int m_SelGrade; public int SealGrade { set { m_SelGrade = value; } get { return m_SelGrade; } } private int m_SealLevel; public int SealLevel { set { m_SealLevel = value; } get { return m_SealLevel; } } private int m_MaskGrade; public int MaskGrade { get { return m_MaskGrade; } set { m_MaskGrade = value; } } private int m_MaskLevel; public int MaskLevel { get { return m_MaskLevel; } set { m_MaskLevel = value; } } private int m_CrownGrade; public int CrownGrade { get { return m_CrownGrade; } set { m_CrownGrade = value; } } private int m_CrownLevel; public int CrownLevel { get { return m_CrownLevel; } set { m_CrownLevel = value; } } #endregion // 进阶的所有数据 private Dictionary advanceDataDic; public Dictionary AdvanceDataDic { get { if (advanceDataDic == null) { advanceDataDic = new Dictionary(); } return advanceDataDic; } } public void AdvanceSkillChange(int type,int NewSkillID) { if (NewSkillID <= 0) return; if (advanceDataDic.ContainsKey(type) == false) return; AdvanceInfo advanceInfo = advanceDataDic[type]; advanceInfo.AddSkill(NewSkillID); } /// /// 保存进阶数据 /// /// 进阶类型 /// AdvanceInfo进阶数据 public void SaveData(int adType, AdvanceInfo data) { if(advanceDataDic == null) { advanceDataDic = new Dictionary(); } if(!advanceDataDic.ContainsKey(adType)) { advanceDataDic.Add(adType, data); } else { advanceDataDic[adType] = data; } } public void SaveData(int adType, AdvanceRetInfo data) { if (advanceDataDic == null) { advanceDataDic = new Dictionary(); } if (!advanceDataDic.ContainsKey(adType)) { AdvanceInfo adInfo = new AdvanceInfo(); adInfo.baseId = (data.type + 1) *1000 + data.level; adInfo.level = data.level; adInfo.type = data.type; adInfo.wish = data.wish; advanceDataDic.Add(adType, adInfo); } else { advanceDataDic[adType].baseId = (data.type + 1) * 1000 + data.level; advanceDataDic[adType].level = data.level; advanceDataDic[adType].wish = data.wish; } } public int GetAdvanceLevel(int adType) { if(!AdvanceDataDic.ContainsKey(adType)) { return -1; } else { return AdvanceDataDic[adType].level; } } public int GetAdvanceGrade(int adType) { switch(adType) { case (int)AdvanceMountPanelCtr.AdvanceType.Ride: return RideGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Piano: return GodWeaponGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Wing: return WingGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Qilinbi: return WishGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Soul: return SealGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Mask: return MaskGrade; case (int)AdvanceMountPanelCtr.AdvanceType.Huopao: return CrownGrade; } return 0; } // 战力值字典 <进阶类型, 战力值> public Dictionary combatValueDic = new Dictionary(); public Dictionary m_AdvanceFashionDic = new Dictionary(); public void AddToFashionDic(GC_ADVANCE_FASHION_INFO packet) { for(int index = 0; index < packet.infoCount; index++) { if (m_AdvanceFashionDic.ContainsKey(packet.GetInfo(index).Id)) { m_AdvanceFashionDic[packet.GetInfo(index).Id] = packet.GetInfo(index).Time; } else { m_AdvanceFashionDic.Add(packet.GetInfo(index).Id, packet.GetInfo(index).Time); } } } /// /// 添加或更新进阶的战力值,会发出提示。 /// /// 进阶类型 /// 战力值 public void AddCombatValue(int type, int value) { //if (combatValueDic.ContainsKey(type)) //{ // if (value > combatValueDic[type]) // { // GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{43037}", value - combatValueDic[type])); // } // combatValueDic[type] = value; //} //else //{ // GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{43037}", value)); // combatValueDic.Add(type, value); //} } /// /// 添加或更新进阶的战力值,不会发出提示。 /// /// 进阶类型 /// 战力值 public void AddCombatValueWithoutNotify(int type, int value) { if (combatValueDic.ContainsKey(type)) { combatValueDic[type] = value; } else { combatValueDic.Add(type, value); } } }