示例#1
0
 public void RemoveTotem(TotemData data)
 {
     if (TotemDic.ContainsKey(data.md5))
     {
         TotemDic.Remove(data.md5);
     }
     ZEventSystem.Dispatch(EventConst.TOTEMDATACHANGE);
 }
示例#2
0
 public void AddTotem(TotemData data)
 {
     if (TotemDic.ContainsKey(data.md5))
     {
         return;
     }
     TotemDic.Add(data.md5, data);
     ZEventSystem.Dispatch(EventConst.TOTEMDATACHANGE);
 }
示例#3
0
    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);
    }
示例#4
0
    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();
    }