public void RemoveTotem(TotemData data) { if (TotemDic.ContainsKey(data.md5)) { TotemDic.Remove(data.md5); } ZEventSystem.Dispatch(EventConst.TOTEMDATACHANGE); }
public void AddTotem(TotemData data) { if (TotemDic.ContainsKey(data.md5)) { return; } TotemDic.Add(data.md5, data); ZEventSystem.Dispatch(EventConst.TOTEMDATACHANGE); }
public TotemData[] GetHeroTotem(string[] totemArray) { TotemData[] ret = new TotemData[totemArray.Length]; for (int i = 0; i < totemArray.Length; ++i) { if (TotemDic.ContainsKey(totemArray[i])) { ret[i] = TotemDic[totemArray[i]]; } } return(ret); }
public void TakeTotem(TotemData td, HeroData hd) { if (!TotemDic.ContainsKey(td.md5)) { return; } int res = HeroMgr.GetSingleton().TakeHeroTotem(hd, td); if (res == int.MaxValue) { return; } //服务器处理 这里模拟 td.HeroID = hd.HeroId; td.Groove = res; hd.ClearTotemAttr(); }