public bool IsParallelBlockFinished(ActionEntryContainer container) { if (EntryType == ActionEntryType.ParallelBlock) { foreach (var childEntry in GetChildEntries(container)) { if (!childEntry.IsParallelBlockFinished(container)) { return(false); } } return(true); } else { if (!HasNext) { return(PrimaryAction == null || PrimaryAction.IsDone()); } int last = NextId; int next = container.GetEntry(last).NextId; while (next != kNotExistId) { last = next; next = container.GetEntry(next).NextId; } return((PrimaryAction == null || PrimaryAction.IsDone()) && (container.GetEntry(last).PrimaryAction == null || container.GetEntry(last).PrimaryAction.IsDone())); } }
public List <ActionEntry> GetChildEntries(ActionEntryContainer container) { return(childEntryIds.Select(id => container.GetEntry(id)).ToList()); }