コード例 #1
0
        /// <summary>
        /// Evaluates its bound runtime condition.
        /// </summary>
        /// <returns>
        /// If the condition was true returns the child value.
        /// If the condition was false returns failure.
        /// </returns>
        public override Result Execute()
        {
            if (runtimeCondition.Evaluate())
            {
                var isRunning = child.Execute();
                if (isRunning == Result.Running)
                {
                    parentTree.contextWalker.SetContextPointer(context);
                }
                return(isRunning);
            }

            return(Result.Failure);
        }