Ejemplo n.º 1
0
        public bool Condition(ConditionParameter conditionParameter)
        {
            bool result = true;
            List <ConditionGroupParameter> groupList = conditionParameter.GetGroupList();

            for (int i = 0; i < groupList.Count; ++i)
            {
                ConditionGroupParameter groupParameter = groupList[i];
                result = true;

                for (int j = 0; j < groupParameter.parameterList.Count; ++j)
                {
                    NodeParameter parameter = groupParameter.parameterList[j];
                    bool          value     = Condition(parameter);
                    if (!value)
                    {
                        result = false;
                        break;
                    }
                }

                if (result)
                {
                    break;
                }
            }

            return(result);
        }
Ejemplo n.º 2
0
        public void Init(List <ConditionGroup> conditionGroupList, List <NodeParameter> parameterList)
        {
            if (init)
            {
                return;
            }
            init = true;

            for (int i = 0; i < conditionGroupList.Count; ++i)
            {
                ConditionGroup          conditionGroup = conditionGroupList[i];
                ConditionGroupParameter group          = GetParameter(conditionGroup, parameterList);
                groupList.Add(group);
            }
        }
Ejemplo n.º 3
0
        private ConditionGroupParameter GetParameter(ConditionGroup conditionGroup, List <NodeParameter> parameterList)
        {
            ConditionGroupParameter group = new ConditionGroupParameter();

            for (int i = 0; i < conditionGroup.parameterList.Count; ++i)
            {
                string parameter = conditionGroup.parameterList[i];
                for (int j = 0; j < parameterList.Count; ++j)
                {
                    if (parameter.CompareTo(parameterList[j].parameterName) == 0)
                    {
                        group.parameterList.Add(parameterList[j]);
                    }
                }
            }

            return(group);
        }