protected bool TaskRunnable(TaskMachineTask t) { if (t.WaitState == TaskWaitState.NONE) { return(true); } return(false); }
protected TaskMachineTask FindNextTask(int from) { int t = from + 1; do { TaskMachineTask task = Tasks[t % Tasks.Count]; if (TaskRunnable(task)) { return(task); } t = ++t % Tasks.Count; } while (t != from); return(null); }