示例#1
0
        public static void SanityCheckEventList()
        {
            using (List <SkillEvent> .Enumerator enumerator = SkillEvent.EventList.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    SkillEvent current = enumerator.get_Current();
                    if (SkillEvent.IsEventGlobal(current.name))
                    {
                        current.isGlobal = true;
                    }
                    if (current.isGlobal && !SkillEvent.globalEvents.Contains(current.name))
                    {
                        SkillEvent.globalEvents.Add(current.name);
                    }
                }
            }
            List <SkillEvent> list = new List <SkillEvent>();

            using (List <SkillEvent> .Enumerator enumerator2 = SkillEvent.EventList.GetEnumerator())
            {
                while (enumerator2.MoveNext())
                {
                    SkillEvent current2 = enumerator2.get_Current();
                    if (!SkillEvent.EventListContainsEvent(list, current2.Name))
                    {
                        list.Add(current2);
                    }
                }
            }
            SkillEvent.EventList = list;
        }
示例#2
0
        public SkillEvent(string name)
        {
            object obj;

            Monitor.Enter(obj = SkillEvent.syncObj);
            try
            {
                this.name = name;
                if (!SkillEvent.EventListContainsEvent(SkillEvent.EventList, name))
                {
                    SkillEvent.EventList.Add(this);
                }
            }
            finally
            {
                Monitor.Exit(obj);
            }
        }