Example #1
0
    public TotemData GetTotemByID(string id)
    {
        TotemData ret;

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