示例#1
0
        public BuffManager()
        {
            updateBuffsTimer.Setup(1, (delta) => {
                foreach (var pair in buffs)
                {
                    pair.Value.Update(delta);
                }
            });
            removeExpiredTimer.Setup(1, (delta) => {
                List <string> keys = new List <string>();
                foreach (var pair in buffs)
                {
                    if (!pair.Value.IsValid)
                    {
                        keys.Add(pair.Key);
                    }
                }

                foreach (string key in keys)
                {
                    BuffInfo buff = buffs[key];
                    buffs.Remove(key);
                    //buff removed event
                    RavenhillEvents.OnBuffRemoved(buff);
                }
            });
        }