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(); }
public void Remove(TimerGameAction action) { removes.Add(action); }
public virtual void Register(int key, TimerGameAction action) { adds.Add(action); }