//------------------------------------------------------------------------- public void update(float tm) { foreach (var i in ListFTask) { if (i.Done()) { ListDoneTask.Add(i); } else { i.update(tm); } } if (ListDoneTask.Count == ListFTask.Count) { IsAllDone = true; if (!CancelTask && AllTaskDoneCallBack != null) { AllTaskDoneCallBack(MapParam); AllTaskDoneCallBack = null; } ListDoneTask.Clear(); ListFTask.Clear(); } }
//------------------------------------------------------------------------- public void whenAll(Dictionary <byte, object> map_param, AllTaskDoneCallBack alltask_done_callback, params FTask[] task) { MapParam = map_param; AllTaskDoneCallBack = alltask_done_callback; foreach (var i in task) { ListFTask.Add(i); } IsAllDone = false; CancelTask = false; }
//------------------------------------------------------------------------- public void cancelTask() { CancelTask = true; ListFTask.Clear(); ListDoneTask.Clear(); }