// Executes the code the block represents, either returning a value or performing // some action and calling evaluate on the block's successor public BehaviorData Evaluate() { BehaviorData result = InnerEvaluate(); if (result.GetReturnType() != OutputType()) { throw new SystemException("Unexpected return type."); } next.Evaluate(); return(result); }