public void AddTransition(ActionNode nodeFrom, ActionNode nodeTo, Func <bool> condition, Action transitionAction) { if (nodeFrom == null || nodeTo == null) { throw new ArgumentNullException("Must define a start and an end node."); } if (nodeFrom.Equals(nodeTo)) { throw new Exception("Start node cannot equal end node."); } // Does not prevent the user from creating circular dependencies. transitionPool.Add(new Transition(context) { NodeFrom = nodeFrom, NodeTo = nodeTo, CanTransition = condition, ActionForward = transitionAction }); }