Example #1
0
        public CBuff CreateBuff(string rid, CEntity caster, CEntity target)
        {
            CBuff buff = this._gPool.Pop <CBuff>();

            buff.OnCreate(this._battle, rid, caster, target);
            this._idToBuff[buff.rid] = buff;
            this._buffs.Add(buff);
            return(buff);
        }
Example #2
0
        internal void Update(UpdateContext context)
        {
            int count = this._buffs.Count;

            for (int i = 0; i < count; i++)
            {
                CBuff buff = this._buffs[i];
                buff.OnUpdate(context);
            }
            //清理CBuff
            this.DestroyBuffs();
        }
Example #3
0
        private void DestroyBuffs()
        {
            int count = this._buffs.Count;

            for (int i = 0; i < count; i++)
            {
                CBuff buff = this._buffs[i];
                if (!buff.markToDestroy)
                {
                    continue;
                }
                buff.OnDestroy();

                this._buffs.RemoveAt(i);
                this._idToBuff.Remove(buff.rid);
                this._gPool.Push(buff);
                --i;
                --count;
            }
        }
Example #4
0
        public void HandleBuffDestroied(string buffId)
        {
            CBuff buff = this._buffManager.GetBuff(buffId);

            buff.MarkToDestroy();
        }