using System.Collections.Generic; using LuaInterface; namespace MoleMole { public class LDEvtWaitAll : BaseLDEvent { private List _LDEventList; public LDEvtWaitAll(LuaTable LDEventTable) { _LDEventList = new List(); foreach (object value in LDEventTable.Values) { BaseLDEvent item = Singleton.Instance.CreateLDEventFromTable((LuaTable)value); _LDEventList.Add(item); } } public override void Core() { foreach (BaseLDEvent lDEvent in _LDEventList) { if (lDEvent.isDone) { _LDEventList.Remove(lDEvent); } } if (_LDEventList.Count == 0) { Done(); } } } }