Beispiel #1
0
        public bool FireTrigger(string name)
        {
            current = getTrigger(name);

            if (current != null)
            {
                IsActive = true;
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        public SerializeableNodeViewModel GoToNextNode()
        {
            if (current != null)
            {
                int nextID = 0;
                if (current.NodeType == NodeType.RootNode)
                {
                    SerializeableRootNode root = current as SerializeableRootNode;
                    nextID = root.OutputNodeID;
                }

                if (current.NodeType == NodeType.MethodNode)
                {
                    SerializeableDynamicNode method = current as SerializeableDynamicNode;
                    nextID = method.OutputNodeID;
                }

                if (current.NodeType == NodeType.ConditionNode)
                {
                    SerializeableConditionNode condition = current as SerializeableConditionNode;
                    string varToCheck = condition.BoolVariableName;
                    bool   toCheck    = getBoolVariableValue(condition.BoolVariableName, condition.BoolCallingClass);

                    if (toCheck == true)
                    {
                        nextID = condition.OutputTrueNodeID;
                    }
                    else
                    {
                        nextID = condition.OutputFalseNodeID;
                    }
                }

                current = getNodeByID(nextID);
            }

            //mark as not active
            if (current == null)
            {
                IsActive = false;
            }

            return(current);
        }