Beispiel #1
0
        public virtual void TimeElapse(IEventArgs args, int time)
        {
            if (map.Count != last)
            {
                last = map.Count;
                //List<string> list = new List<string>();
                //foreach (TimerGameAction ta in map)
                //{
                //    list.Add(ta.ToString());
                //}
                //Debug.LogError("all:" + StringUtil.GetStringFromStrings(list, ","));
            }
            Iterator <TimerGameAction> it = map.Iterator();

            while (it.HasNext())
            {
                TimerGameAction action = it.Next();
                action.TimeElapse(args, time);
            }

            if (removes.Count > 0)
            {
                foreach (var remove in removes)
                {
                    map.Remove(remove);
                }
                removes.Clear();
            }

            foreach (TimerGameAction action in adds)
            {
                map.Add(action);
            }
            adds.Clear();
        }