コード例 #1
0
ファイル: Oni.cs プロジェクト: 17cuA/Docking_Game
 public ConstraintParameters(bool enabled, EvaluationOrder order, int iterations)
 {
     this.enabled         = enabled;
     this.iterations      = iterations;
     this.evaluationOrder = order;
     this.SORFactor       = 1;
 }
コード例 #2
0
ファイル: NodeData.cs プロジェクト: tuvoksg1/ProvingGround
        public static IEnumerable <ITreeNode> GetEnumerable(this ITreeNode node, EvaluationOrder evaluationOrder)
        {
            if (evaluationOrder == EvaluationOrder.ParentFirst)
            {
                yield return(node);
            }

            if (node.Outcome.Type == ResultType.Pass)
            {
                foreach (var child in node.Children)
                {
                    var childEnumerator = child.GetEnumerable(evaluationOrder).GetEnumerator();

                    while (childEnumerator.MoveNext())
                    {
                        yield return(childEnumerator.Current);
                    }
                }
            }

            if (evaluationOrder == EvaluationOrder.ChildrenFirst)
            {
                yield return(node);
            }
        }
コード例 #3
0
        public IActionResult PostEvaluatuin(int providerID, int starScore, string content)
        {
            var entity = new EvaluationOrder()
            {
                ServiceProvider = _serviceProviderService.FindById(providerID),
                SysUser         = _sysUserService.FindById(WebHelper.WebHelper.UserSession.ID),
                Content         = content.Trim(),
                Star            = starScore,
                EvaluationStart = DateTime.Now
            };

            _evaluationOrderService.Insert(entity);

            return(Redirect("/ServiceProvider/ServiceProviderDetails?id=" + providerID));
        }
コード例 #4
0
ファイル: RuleExtension.cs プロジェクト: tuvoksg1/RulesEngine
        /// <summary>
        /// Gets the enumerable list of rule in the required order.
        /// </summary>
        /// <param name="rule">The node.</param>
        /// <param name="evaluationOrder">The evaluation order.</param>
        /// <returns></returns>
        public static IEnumerable<IRule> GetEnumerable(this IRule rule, EvaluationOrder evaluationOrder)
        {
            if (evaluationOrder == EvaluationOrder.ParentFirst)
            {
                yield return rule;
            }

            foreach (var child in rule.Children)
            {
                var childEnumerator = child.GetEnumerable(evaluationOrder).GetEnumerator();

                while (childEnumerator.MoveNext())
                {
                    yield return childEnumerator.Current;
                }
            }

            if (evaluationOrder == EvaluationOrder.ChildrenFirst)
            {
                yield return rule;
            }
        }
コード例 #5
0
 public static EvaluationOrderModel ToModel(this EvaluationOrder entity)
 {
     return(entity.MapTo <EvaluationOrder, EvaluationOrderModel>());
 }
コード例 #6
0
ファイル: NodeData.cs プロジェクト: tuvoksg1/ProvingGround
        public static IEnumerable<ITreeNode> GetEnumerable(this ITreeNode node, EvaluationOrder evaluationOrder)
        {
            if (evaluationOrder == EvaluationOrder.ParentFirst)
            {
                yield return node;
            }

            if (node.Outcome.Type == ResultType.Pass)
            {
                foreach (var child in node.Children)
                {
                    var childEnumerator = child.GetEnumerable(evaluationOrder).GetEnumerator();

                    while (childEnumerator.MoveNext())
                    {
                        yield return childEnumerator.Current;
                    }
                }
            }

            if (evaluationOrder == EvaluationOrder.ChildrenFirst)
            {
                yield return node;
            }
        }