public List <LZFighterStateTransition> GetStateTransitions(int state) { List <LZFighterStateTransition> result = transitions.FindAll((t) => t.source == state); List <int> shortcuts = states.FindAllIndex((s) => s.IsShortcut && s.Target == state); foreach (var id in shortcuts) { result.AddRange(GetStateTransitions(id)); } return(result); }